HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/lib/python2.7/dist-packages/mercurial/revlog.pyc

Xc@@sdZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
ddlmZddlmZmZmZmZmZmZejZejZejZejZdZdZ dZ!dZ"e!Z#e Z$e$e#BZ%e!e"BZ&dZ'dZ(e'Z)dZ*dZ+ej,Z,ej-Z-ej.Z.d
Z/dZ0dZ1ej2eZ3dZ4dZdZ5de6fdYZ7dZ8dZ9dZ:de6fdYZ;de6fdYZ<dS(sStorage back-end for Mercurial.

This provides efficient delta storage with O(1) retrieve and append
and O(changes) merge between branches.
i(tabsolute_importNi(tbinthextnullidtnullrev(t_(tancestorterrortmdifftparsersttemplatefilterstutiliiiiicC@st|d?S(Ni(tint(tq((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	getoffsetDscC@st|d@S(Ni(R(R
((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytgettypeGscC@stt|d>|BS(Ni(tlong(toffsetttype((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytoffset_typeJscC@sy|tkr(tj}|j|n:||g}|jtj|d}|j|d|j||jS(sgenerate a hash from the given text and its parent hashes

    This hash combines both the current file contents and its history
    in a manner that makes it easy to distinguish nodes with the same
    content in the revision graph.
    ii(Rt	_nullhashtcopytupdatetsortthashlibtsha1tdigest(ttexttp1tp2tstl((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pythashOs

cC@s|s
|S|d}|dkr$|S|dkrvyt|SWqvtjk
rr}ttdt|qvXn|dkrtj|dSttd|dS(	s decompress the given input istxsrevlog decompress error: %stuisunknown compression type %rN(t_decompresstzlibRtRevlogErrorRtstrRtbuffer(Rttte((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
decompressds
#s>4l20s20s20strevlogoldiocB@s#eZdZdZdZRS(cC@stjt|_dS(N(tstructtcalcsizet
indexformatv0tsize(tself((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__init__sc	C@s%|j}g}itt6}d}}t|}x|||kr||||!}	||7}tt|	}
t|
dd|
dd|
d|
d|j|
dt|j|
dt|
df}|j||||
d<|d7}q5W|jdddddddtf||dfS(	Niiiiiiii(
R/RRtlent_unpackR.RtgettappendtNone(R0tdatatinlineRtindextnodemaptntoffRtcurR)te2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
parseindexs 	


(3
%cC@s{t|dr%ttdnt|d|d|d|d||d||d|df}tt|S(	Nisindex entry flags need RevlogNGiiiiii(RR%RRt_packR.(R0tentrytnodetversiontrevR>((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	packentrys
"'(t__name__t
__module__R1R?RE(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR+~s		s>Qiiiiii20s12xs>IitrevlogiocB@s#eZdZdZdZRS(cC@stjt|_dS(N(R,R-t
indexformatngR/(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR1scC@s1tj||\}}|t|dd|fS(NR:(R	tparse_index2tgetattrR6(R0R7R8R9tcache((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR?scC@s9tt|}|dkr5tt||d}n|S(Nii(R@RIt
versionformat(R0RARBRCRDtp((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyREs(RFRGR1R?RE(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRHs		trevlogcB@seZdZedZdZdZdZdZddGdZ
ejdZ
d	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdGdZdZdZeZdedZdZ dGdGdZ!dGdZ"dGdGdZ#dGdGdZ$dGdGdZ%d Z&d!Z'd"Z(dGdGd#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2d-Z3dGd.Z4dGd/Z5dGd0Z6dGd1Z7dGd2Z8d3Z9d4Z:d5Z;dGd6Z<d7Z=d8Z>dGd9Z?dGd:Z@dGdGd;ZAd<ZBd=ZCed>ZDd?ZEdGd@ZFdAZGdBZHdCZIdDZJdEZKdFZLRS(Hs
    the underlying revision storage object

    A revlog consists of two parts, an index and the revision data.

    The index is a file with a fixed record size containing
    information on each revision, including its nodeid (hash), the
    nodeids of its parents, the position and offset of its data within
    the data file, and the revision it's based on. Finally, each entry
    contains a linkrev entry that can serve as a pointer to external
    data.

    The revision data itself is a linear collection of data chunks.
    Each chunk represents a revision and is usually represented as a
    delta against the previous chunk. To bound lookup time, runs of
    deltas are limited to about 2 times the length of the original
    version data. This makes retrieval of a version proportional to
    its size, or O(1) relative to the number of revisions.

    Both pieces of the revlog are written to in an append-only
    fashion, which means we never need to rewrite a file to insert or
    remove data, and can use some simple techniques to avoid the need
    for locking while reading.

    If checkambig, indexfile is opened with checkambig=True at
    writing, to avoid file stat ambiguity.
    c
C@s	||_|d d|_||_||_d|_tjd|_d|_	d|_
d|_t|_
g|_i|_itt6|_d|_t}t|dd}|dk	rZd|krd	|kr|tO}qnd}d
|kr|d
|_
nd|kr |d|_nd|kr<|d|_
nt|jd
t|_n|j
dkrttd|j
n0|j
|j
d@rttd|j
nd}t|_yd|j|j}|j}|jt |dkr't!j"t#|d d}t|_nWn+t$k
rU}|j%t%j&krVqVnX||_'|t(@|_)|t@|_*|d@}	|d@}
|
t+kr|	rttd|j|	d?fnk|
t,kr|	t-@rttd|j|	d?fn.|
t,kr0ttd|j|
fnt|_.t/|_0|j't+krct1|_0ny|j0j2||j)}Wn0t3t4fk
rttd|jnX|\|_}|_	|dk	r||_5|_n|j	s|j6ni|_7dS(s
        create a revlog object

        opener is a function that abstracts the file opening operation
        and can be used to implement COW semantics or the like.
        is.didititoptionstrevlogv1tgeneraldeltatchunkcachesizetmaxchainlentaggressivemergedeltast
lazydeltabases0revlog chunk cache size %r is not greater than 0is.revlog chunk cache size %r is not a power of 2iis*index %s unknown flags %#04x for format v0is)index %s unknown flags %#04x for revlogngsindex %s unknown format %dsindex %s is corruptedN(iRPi(8t	indexfiletdatafiletopenert_checkambigR6t_cacheRtlrucachedictt_chainbasecachet_chunkcachet_chunkcachesizet_maxchainlentFalset_aggressivemergedeltasR9t_pcacheRRt
_nodecachet_nodepostREVLOG_DEFAULT_VERSIONRKtREVLOGGENERALDELTAtboolR4t_lazydeltabaseR%RtTruet
_initemptytreadtcloseR2R,tunpackRMtIOErrorterrnotENOENTRCtREVLOGNGINLINEDATAt_inlinet
_generaldeltatREVLOGV0tREVLOGNGtREVLOGNG_FLAGStstoredeltachainsRHt_ioR+R?t
ValueErrort
IndexErrorR:t_chunkcleart_chaininfocache(
R0RZRXt
checkambigtvtoptst	indexdatatftinsttflagstfmttdR:((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR1s												

	



		
cC@s|jt|jdS(Ni(RBR2R9(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyttip=scC@sd|kot|kSS(Ni(R2(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__contains__?scC@st|jdS(Ni(R2R9(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__len__AscC@sttt|S(N(titertxrangeR2(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__iter__CsicC@sPd}|dk	r4||kr'd}n||7}nt|}t|||S(s8iterate over all rev in this revlog (from start to stop)iiN(R6R2R(R0tstarttstoptstep((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrevsEs	
cC@s|j|jd|jS(Ni(RDRBRe(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR:PscC@s.y|j|tSWntk
r)tSXdS(N(RDRktKeyErrorRb(R0RB((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pythasnodeUs


cC@sjd|_|jjd|_i|_y|jjWn*tk
reit	t
6|_d|_nXdS(NiRP(iRP(R6R\R^tclearR_RdRetclearcachestAttributeErrorRRRf(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR\s	
		
cC@sy|j|SWntk
r%ntk
rPt||jtdntk
r|j}|j}|j}|dkrt
|d}nxOt|ddD];}||d}|||<||kr|d|_|SqWt||jtdnXdS(Nsno nodeiiii(Ret	TypeErrorR%tLookupErrorRXRRR9RfR6R2R(R0RBR;tiRNtrR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRDhs&


			

cC@s|j|dS(Ni(R9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRBscC@s|j|dS(Ni(R9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytlinkrevscC@s>|j}||j|}||dd||ddfS(Niii(R9RD(R0RBRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytparentss	cC@s|j|dd!S(Nii(R9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
parentrevsscC@st|j|dd?S(Nii(RR9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscC@s|j||j|S(N(Rtlength(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytendscC@s|j|dS(Ni(R9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscC@sq|jj|}|dk	r"|S|j}||d}x$||kr_|}||d}q<W||j|<|S(Ni(R^R4R6R9(R0RDtbaseR9((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	chainbases	
cC@s|j|dS(Ni(t
_chaininfo(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytchainlenscC@s|j}||kr||S|j}|j}|}||}d}d}x||dkr|d7}||d7}|r|d}n
|d8}||kr||}	||	d7}||	d7}Pn||}qNW||d7}||f}
|
||<|
S(Niii(R~R9Ru(R0RDtchaininfocacheR9RStiterrevR)tclentcompresseddeltalenR(R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs2			





c	C@sg}|j}|j}|}||}xT||dkr~||kr~|j||rg|d}n
|d8}||}q+W||krt}n|j|t}|j||fS(sWObtain the delta chain for a revision.

        ``stoprev`` specifies a revision to stop at. If not specified, we
        stop at the base of the chain.

        Returns a 2-tuple of (chain, stopped) where ``chain`` is a list of
        revs in ascending order and ``stopped`` is a bool indicating whether
        ``stoprev`` was hit.
        ii(R9RuR5RkRbtreverse(	R0RDtstoprevtchainR9RSRR)tstopped((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_deltachains"
		



	

cC@s|j|dd@S(Nii(R9(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscC@sC|j|d}|dkr!|S|j|j|}t|S(s?return the length of the uncompressed text for a given revisionii(R9trevisionRBR2(R0RDRR(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrawsizes
cC@stj|j|d|d|S(sGenerate the ancestors of 'revs' in reverse topological order.
        Does not generate revs lower than stoprev.

        See the documentation for ancestor.lazyancestors for more details.Rt	inclusive(Rt
lazyancestorsR(R0RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	ancestorsscc@st|}|tkr2x|D]}|VqWdSt|}xf|jd|dD]N}xE|j|D]4}|tkrk||krk|j||VPqkqkWqUWdS(s$Generate the descendants of 'revs' in revision order.

        Yield a sequence of revision numbers starting with a child of
        some rev in revs, i.e., each revision is *not* considered a
        descendant of itself.  Results are ordered by revision number (a
        topological sort).NRi(tminRtsetRRtadd(R0RtfirstRtseenR!((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytdescendantss
	
c	@s|dkrtg}n|dkr3|j}ng|D]}|j|^q:}g|D]}|j|^q\}dtfdY}||j|jtj|t	}t
jfd|D}xk|rQ|j}||krqq|j|x3|j
|D]"}|kr(|j|q(q(WqWt|}|jg|D]}|j|^qrfS(sReturn a tuple of the ancestors of common and the ancestors of heads
        that are not ancestors of common. In revset terminology, we return the
        tuple:

          ::common, (::heads) - (::common)

        The list is sorted by revision number, meaning it is
        topologically sorted.

        'heads' and 'common' are both lists of node IDs.  If heads is
        not supplied, uses all of the revlog's heads.  If common is not
        supplied, uses nullid.tlazysetcB@s5eZdZdZdZdZdZRS(cS@st|_||_dS(N(Rtaddedvaluest
lazyvalues(R0R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR1"scS@s||jkp||jkS(N(RR(R0tvalue((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR&scs@sK|j}x|D]}|VqWx%|jD]}||kr)|Vq)q)WdS(N(RR(R0taddedR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR)s	
	cS@s|jj|dS(N(RR(R0R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR1scS@s|jj|dS(N(RR(R0tvalues((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR4s(RFRGR1RRRR(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR!s
				c3@s!|]}|kr|VqdS(N((t.0R(thas(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pys	<genexpr>=sN(R6RtheadsRDtobjectRRRRRtcollectionstdequetpopleftRR5tlistRRB(	R0tcommonRR;RtmissingtvisitRRN((Rs4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindcommonmissings.
""

		

cC@s+|dkrtg}ntj|j|S(sOReturn an object that can be used to incrementally compute the
        revision numbers of the ancestors of arbitrary sets that are not
        ancestors of common. This is an ancestor.incrementalmissingancestors
        object.

        'common' is a list of revision numbers. If common is not supplied, uses
        nullrev.
        N(R6RRtincrementalmissingancestorsR(R0R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytincrementalmissingrevsKs	cC@sR|dkrtg}n|dkr3|j}n|jd|}|j|S(sxReturn the revision numbers of the ancestors of heads that
        are not ancestors of common.

        More specifically, return a list of revision numbers corresponding to
        nodes N such that every N satisfies the following constraints:

          1. N is an ancestor of some node in 'heads'
          2. N is not an ancestor of any node in 'common'

        The list is sorted by revision number, meaning it is
        topologically sorted.

        'heads' and 'common' are both lists of revision numbers.  If heads is
        not supplied, uses all of the revlog's heads.  If common is not
        supplied, uses nullid.RN(R6RtheadrevsRtmissingancestors(R0RRtinc((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindmissingrevsYscC@s|dkrtg}n|dkr3|j}ng|D]}|j|^q:}g|D]}|j|^q\}|jd|}g|j|D]}|j|^qS(s.Return the ancestors of heads that are not ancestors of common.

        More specifically, return a list of nodes N such that every N
        satisfies the following constraints:

          1. N is an ancestor of some node in 'heads'
          2. N is not an ancestor of any node in 'common'

        The list is sorted by revision number, meaning it is
        topologically sorted.

        'heads' and 'common' are both lists of node IDs.  If heads is
        not supplied, uses all of the revlog's heads.  If common is not
        supplied, uses nullid.RN(R6RRRDRRRB(R0RRR;RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindmissingqs""cC@sgggf}|dk	r\t|}|s1|Stg|D]}|j|^q;}ntg}t}|tkr|dkrg|D]}|j|^qtgt|jfS|dkrt|d}d}i}nt|}|s|St	}t
j|t}t	|}	t
g|	D]}|j|^q-}x|	r|	j}|tkrrqNn|j|}||krN||kr|j||	jg|j|D]}
|
tkr|
^qq||kr|j|qqNqNW|s|S|tkrtg|D]}||kr|^q}|rmtg|D]}|j|^qL}q|Snt}tg}t	|}|j}g}x|jdt
|dd|dD]z}|j|}t}
|tkrt}
n||kr`t}
||krt|j|}
|
d|ksJ|
d|kr]|j|q]qnKt|j|}
|
d|ks|
d|kr|j|t}
n|
r|dks||kr|j||dk	r||krt||<qA|dkrAt||<x*|j|D]}
|j|
dq!WqAqqWg|jD]\}}|rR|^qR}t|}|st|st|st|||fS(sReturn a topological path from 'roots' to 'heads'.

        Return a tuple (nodes, outroots, outheads) where 'nodes' is a
        topologically sorted list of all nodes N that satisfy both of
        these constraints:

          1. N is a descendant of some node in 'roots'
          2. N is an ancestor of some node in 'heads'

        Every node is considered to be both a descendant and an ancestor
        of itself, so every reachable node in 'roots' and 'heads' will be
        included in 'nodes'.

        'outroots' is the list of reachable nodes in 'roots', i.e., the
        subset of 'roots' that is returned in 'nodes'.  Likewise,
        'outheads' is the subset of 'heads' that is also in 'nodes'.

        'roots' and 'heads' are both lists of node IDs.  If 'roots' is
        unspecified, uses nullid as the only root.  If 'heads' is
        unspecified, uses list of all of the revlog's heads.iRiRN(R6RRRDRRRBRR2RtdicttfromkeysRbtmaxtpopRRRRRRkttupletremoveR5t	iteritemstAssertionError(R0trootsRtnonodesR;t	lowestrevRt
highestrevRt
nodestotagRNRt
orderedouttisdescendanttflag((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytnodesbetweens+	8		(	
%+	,	  
	


+cC@s0y|jjSWntk
r+|jSXdS(N(R9RRt	_headrevs(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR&s
cC@s|jj|S(N(R9tcomputephasesmapsets(R0R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
computephases,scC@st|}|stgSdg|d}|j}x<|D]4}d||<||}d||d<||d<q:Wgt|D]\}}|r|^qS(Niiii(R2RR9t	enumerate(R0tcounttisheadR9RR)tval((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR/s	


cC@s|dkrQ|dkrQt|s+tgSg|jD]}|j|^q8S|dkrft}n|dkr{g}ntg|D]}|j|^q}|j|}t|f}t|f}|j}	x|jd|dD]}}xt|	|D]f}
|
|krA||kr1|j	|n|j	|n|
|kr|
|kr|j
|
qqWqWg|D]}|j|^qxS(sreturn the list of all nodes that have no children

        if start is specified, only heads that are descendants of
        start will be returned
        if stop is specified, it will consider all the revs from stop
        as if they had no children
        RiN(R6R2RRRBRRDRRRR(R0RRRR;tstoprevststartrevt	reachableRRRN((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR<s,&		(	cC@sg}|j|}x|jd|dD]}g|j|D]}|tkrB|^qB}|rx[|D]+}||krm|j|j|qmqmWq,|tkr,|j|j|q,q,W|S(s!find the children of a given nodeRi(RDRRRR5RB(R0RBtcRNRtprtprevs((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytchildren^s.
 cC@sQ|tkrtSx:|j|gD]&}||kr9tS||kr#Pq#q#WtS(N(RRkRRb(R0RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
descendantlscC@sz|j||j|}}y|jj||}Wn/ttfk
ritj|j||}nXt|j|S(s@calculate all the heads of the common ancestors of nodes a and b(	RDR9tcommonancestorsheadsRt
OverflowErrorRRtmapRB(R0tatbtancs((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRvscC@s||j||kS(sreturn True if node a is an ancestor of node b

        The implementation of this is trivial but the use of
        commonancestorsheads is not.(R(R0RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
isancestorscC@s|j||j|}}y|jj||}Wn/ttfk
ritj|j||}nX|rtt|j	|St
S(s5calculate the "best" common ancestor of nodes a and b(RDR9RRRRRRRRBR(R0RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscC@sLt|tr|j|St|dkr`y|}|j||SWq`tk
r\q`Xny~t|}t||krtn|dkrt||}n|dks|t|krtn|j|SWnttfk
rnXt|dkrHy!t	|}|j||SWqHt
tfk
rDqHXndS(Niii((t
isinstanceRRBR2RDRR&R{RRR(R0tidRBRD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_matchs6


		
cC@sy3|jj|}|r.|j|r.|SdSWnWtk
rvt|ddst||jtdqnt	t
fk
rnX||jkr|j|St|dkryt|d}t
||d }g|jD]#}|dj|r|d^q}g|D]0}t|j|r|j|r|^q}t|dkrt|dkr|d|j|<|dSt||jtdndSWqtk
rqXndS(Ntfilteredrevssambiguous identifieri(iiii(R9tpartialmatchRR6R%RKRRXRRR{RdR2Rt
startswithRR(R0RR;RtprefixR)tnl((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
_partialmatchs:
3"
cC@sW|j|}|dk	r|S|j|}|r8|St||jtddS(slocate a node based on:
            - revision number or str(revision number)
            - nodeid or subset of hex nodeid
        sno match foundN(RR6RRRXR(R0RR;((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytlookupscC@s+|j|\}}t||||kS(spcompare text with a given file revision

        returns True if text is different than what is stored.
        (RR (R0RBRRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytcmpscC@sj|j\}}|t||krWt|t|tkrW|||f|_n||f|_dS(svAdd a segment to the revlog cache.

        Accepts an absolute offset and the data that is at that location.
        N(R_R2t
_chunksize(R0RR7toR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_addchunks2c	C@s|dk	rt}n6|jr3|j|j}n|j|j}t}|j}||d@}||||d@|}|j||j	|}|r|j
n|j||||ks||krtj
||||S|S(sULoad a segment of raw data from the revlog.

        Accepts an absolute offset, length to read, and an optional existing
        file handle to read from.

        If an existing file handle is passed, it will be seeked and the
        original seek position will NOT be restored.

        Returns a str or buffer of raw byte data.
        iN(R6RbRtRZRXRYRkR`tseekRmRnRRR'(	R0RRtdftclosehandlet	cachesizet
realoffsett
reallengthR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
_loadchunks$			

c	C@s|j\}}t|}||}||}|dkrz||krz|dkrc||krc|Stj||||S|j||d|S(sObtain a segment of raw data from the revlog.

        Accepts an absolute offset, length of bytes to obtain, and an
        optional file handle to the already-opened revlog. If the file
        handle is used, it's original seek position will not be preserved.

        Requests for data may be returned from a cache.

        Returns a str or a buffer instance of raw byte data.
        iR(R_R2RR'R(	R0RRRRRRt
cachestarttcacheend((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_getchunk!s

cC@s|j|}|j|}|jrZ||d|jj7}||d|jj7}n||}||j||d|fS(sObtain a segment of raw data corresponding to a range of revisions.

        Accepts the start and end revisions and an optional already-open
        file handle to be used for reading. If the file handle is read, its
        seek position will not be preserved.

        Requests for data may be satisfied by a cache.

        Returns a 2-tuple of (offset, data) for the requested range of
        revisions. Offset is the integer offset from the beginning of the
        revlog and data is a str or buffer of the raw byte data.

        Callers will need to call ``self.start(rev)`` and ``self.length(rev)``
        to determine where each revision's data begins and ends.
        iR(RRRtRzR/R(R0RtendrevRRRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_chunkraw9s	
cC@s t|j||d|dS(s<Obtain a single decompressed chunk for a revision.

        Accepts an integer revision and an optional already-open file handle
        to be used for reading. If used, the seek position of the file will not
        be preserved.

        Returns a str holding uncompressed data for the requested revision.
        Ri(R*R(R0RDR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_chunkRs	cC@s|s
gS|j}|j}|j}|jj}tj}g}|j}	y*|j|d|dd|\}
}Wn4t	k
rg|D]}|j
|d|^qSXxa|D]Y}||}
|r|
|d|7}
n||}|	t|||
|
|qW|S(sObtain decompressed chunks for the specified revisions.

        Accepts an iterable of numeric revisions that are assumed to be in
        ascending order. Also accepts an optional already-open file handle
        to be used for reading. If used, the seek position of the file will
        not be preserved.

        This function is similar to calling ``self._chunk()`` multiple times,
        but is faster.

        Returns a list with decompressed data for each requested revision.
        iiRi(RRRtRzR/RR'R5RRRR*(R0RRRRR8tiosizeR'RtladdRR7RDt
chunkstarttchunklength((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_chunks]s(
					*
'
$cC@s
d|_dS(sClear the raw chunk cache.iRPN(iRP(R_(R0((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR}scC@s:|j|d}||kr!tS|jr.|S|dSdS(s(return deltaparent of the given revisioniiN(R9RRu(R0RDR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytdeltaparents	cC@sV|tkr4|j||kr4t|j|Stj|j||j|S(s1return or calculate a delta between two revisions(RRR&RRttextdiffR(R0trev1trev2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrevdiffs!c
C@st|tr'|}|j|}n|}d}d}|tkrIdS|jr|jd|krp|jdS|jd}nd}|dkr|j|}n|j|t@rt	t
d|j|t@n|j|d|\}}|r|jd}nd|_|j|d|}	|dkrWt
|	d}|	d}	ntj||	}|j|||}|||f|_|S(	sreturn an uncompressed revision of a given node or revision
        number.

        _df is an existing file handle to read from. It is meant to only be
        used internally.
        RPiiisincompatible revision flag %xRRN(RRRBR6RR\RDRtREVIDX_KNOWN_FLAGSR%RRRR&Rtpatchest
_checkhash(
R0t	nodeorrevt_dfRDRBt	cachedrevRRRtbins((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs<		
cC@st|||S(syCompute a node hash.

        Available as a function so that subclasses can replace the hash
        as needed.
        (R (R0RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR scC@s2|j|\}}|j||||||S(N(Rt	checkhash(R0RRBRDRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscC@sk||j|||krg|}|dkrEtjt|}nttd|j|fndS(Nsintegrity check failed on %s:%s(R R6R
tshortRR%RRX(R0RRRRBRDt	revornode((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR$sc
C@s|js,|jd|jdtkr0dS|j|j}|dkrjttd|jn|d}|dk	r|j|}nt	|d}|j
d}|j|j||r|j
|jn|j|jd}z2x+|D]#}|j|j||dqWWd|jX|j|jddtd|j}|jtM_t|_xC|D];}|jj|j||j|j|}	|j|	qzW|j|j|j||jj|jdS(	sCheck if the revlog is too big for inline and convert if so.

        This should be called after revisions are added to the revlog. If the
        revlog has grown too large to be an inline revlog, it will convert it
        to use multiple index and data files.
        iNs%s not found in the transactioniitwt
atomictempR(RtRRt
_maxinlinetfindRXR6R%RR2RRRYtflushRnRZtwriteRRkR[RCRsRbRzRER9RBtreplaceR/R}(
R0ttrtfpttrinfottrindextdataoffRRRR)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytcheckinlinesizes<,



%	
(
c
C@s&|tkr(ttd|jnt|tkrbttd|jt|fn|pz|j|||}||jkr|Sd}|j	s|j
|jd}n|j
|jdd|j}	z,|j
||||||t||	|
SWd|r|jn|	jXdS(sadd a revision to the log

        text - the revision data to add
        transaction - the transaction object used for rollback
        link - the linkrev data to add
        p1, p2 - the parent nodeids of the revision
        cachedelta - an optional precomputed delta
        node - nodeid of revision; typically node is not specified, and it is
            computed by default as hash(text, p1, p2), however subclasses might
            use different hashing method (and override checkhash() in such case)
        s!attempted to add linkrev -1 to %ss;%s: size of %d bytes exceeds maximum revlog storage of 2GiBsa+RN(RR%RRXR2t
_maxentrysizeR R:R6RtRZRYR[t_addrevisiontREVIDX_DEFAULT_FLAGSRn(
R0RttransactiontlinkRRt
cachedeltaRBtdfhtifh((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytaddrevisions(
		
cC@s0|sd|fSt|}d	}|dkr1n|dkrtj}g}d}x=||kr|d
}|j|j|||!|}qXW|j|jttt||krdj	|}qnt
|}|d	kst||kr&|ddkrd|fSd|fSd|fS(s7 generate a possibly-compressed representation of text RPi,i@BiiisR"Ni(R2R6R$tcompressobjR5tcompressR+tsumRtjoint	_compress(R0RRRtzRNtpostpos2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR><s.




c
C@sw|dkrtS|\}}}}}}}	||dkso||kso|	|dkso|jrs||jkrstStS(sReturns True if the given delta is good. Good means that it is within
        the disk span, disk size, and chain length bounds that we know to be
        performant.iiN(R6RbRaRk(
R0RttextlentdistRR7RRRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_isgooddeltaYsc"	@s|g	
f	d
fd}t
}
|
d}
j|d}
j
j	}}|dkrtj
jdd}nt|}|tkrq
jrqt	}rK
j
rK
jrK|d}|jd
j
||rK|}qKn|dkr,
j
r,g||fD]$}|tkrm||krm|^qm}|r
jrt|g}n|j|g}x<|D]4}||}
j
||r|j|qqW|r,t|dd}q,n|dkrq||krq||}
j
||rn|}qnqqn|dk	r|\}}}}}}}n@}
j|}t|dt|d}|
}}t||||||f} 
jjd| |

j<
jj| 
j
j|
}!
j||!|||r|dkr}nt|tkr|
|f
_n|
j |
<S(	sinternal function to add revisions to the log

        see addrevision for argument descriptions.
        invariants:
        - text is optional (can be None); if not set, cachedelta must be set.
          if both are set, they must correspond to each other.
        c@s4ddk	rdSd}d}tjd}|| tjj|t||kr{||d<nLjr}n}jj	|d|}tj
||d<yAjdt@rt
tdnWn!tk
r+t@s,q,nXdS(Niis>lllR!snode %s is not censored(R6R,R-RtreplacediffheaderRR2RtRRBtpatchR$tREVIDX_ISCENSOREDR%RtCensoredNodeError(tbaserevtdeltathlentfhtbasetext(	tbtextR9R:RR;RBRRR0(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	buildtextvs*

		



c
@sbr#d|kr#d}n}j|ritjj|t|}||}nHjr{}n}jj|d|}tj||}j	|\}}t|t|}j
|}|j|}	jr|}
n|}
j
|\}}|d7}||7}|	|||f|
|||fS(NiiR!(t
iscensoredRRHRR2RtRRBRR>RRRuR(
RDRMR(theaderROtptextR7tdeltalenRRFRRR(RRR9R:R;RR0(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
builddeltas.
	!
				

iitkeycS@s|dS(Ni((R!((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt<lambda>siN(!R2RR6RDRtpatchedsizeRRRyRRuRjRRGRcRRR5RR>RR9tinsertR:RzRERBRCt_writeentryRR&R\R^("R0RBRR7R8RRRR9R;R:talwayscacheRWtcurrtprevRMtp1rtp2rREttestedtcandidatedeltaRNRtpdeltastpdRFRR7RRRRR)RA((RQRRR9R:RR;RBRRRR0s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR5lsl		' 
	$

	

!
c	C@s$|jdtj|r/|jdtjnt|d}|js|j|j||j|j|t||dr|j|dn|j|d|j|ni|||j	j
7}|j|j|||j||j|d|j|d|j||dS(Nii(RtostSEEK_ENDR2RtRRYRXR,RzR/R3(	R0R7R;R:RAR7R8RR^((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR\s"	

c@sg}d}t|}d}|r:|j|d}n|j|jdd|j||jj}	|jr|j	|j||	|dn>|j	|j|	||j	|j
||j|j
dfd}
zdxxtfdiD][}|d}|d}|d	}
|d
}|d}|d}|d
pXt}|j
|||}||jkr|q	nxA||
fD]3}||jkrt||jtdqqW||jkrt||jtdn|j|}|tkr|j|rtjd}|j|}t||}|| tj||krtj|j|j|qn|r|j|||
r|tO}n|j|d||||
|||fdt|
|r||nr	|jr	j |j|j
d|j|jdd|jq	q	WWdrj nj X|S(s\
        add a delta group

        given a set of deltas, add them to the revision log. the
        first delta is against its parent, which should be in our
        log, the rest are against the previous delta.

        If ``addrevisioncb`` is defined, it will be called with arguments of
        this revlog and the node that was added.
        iisa+Rc@s!rjnjdS(N(R+((R:R;(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR+9s
c@s
jS(N(t
deltachunk((tcgR(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRY@sRBRRtcst	deltabaseRMRsunknown parentsunknown delta bases>lllR]N(!R6R2RRZRXR[RzR/RtRRYRR6R5R:RRRDRRSR,R-RRRHRtCensoredBaseErrorRBt_peek_iscensoredRJR5RiRn(R0Rit
linkmapperR7t
addrevisioncbtcontentRBRRtisizeR+t	chunkdataRRRjRkRMRR8RNRLRNtoldlentnewlen((RiRR:R;s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytaddgroups|
		"







	

cC@stS(s%Check if a file revision is censored.(Rb(R0RD((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRSscC@stS(s6Quickly check if a delta produces a censored revision.(Rb(R0RLRMR+((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRmscC@s't}t|}i}t}xI|jD];}|j|}|||<||kr1|j|q1q1Wx|r|d8}|j|}||kr|j|n
|j|x[|j|D]J}	|	tkr|j|	}
|
||	<|
|kr|j|
qqqWqsW||fS(sfind the minimum rev that must be stripped to strip the linkrev

        Returns a tuple containing the minimum rev and a set of all revs that
        have linkrevs that will be broken by this strip.
        i(	RR2RRRRRRR(R0tminlinkt
brokenrevst
strippointRtfuturelargelinkrevstheadtheadlinkrevRRNtplinkrev((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
getstrippoints,		
	


cC@st|dkrdS|j|\}}|t|krAdS|j|}|js|j|j|||jj}n|||jj7}|j|j|d|_
i|_|jx0t
|t|D]}|j|j|=qW|j|d5dS(s7truncate the revlog on the first revision with a linkrev >= minlink

        This function is called when we're stripping revision minlink and
        its descendants from the repository.

        We have to remove all revisions with linkrev >= minlink, because
        the equivalent changelog revisions will be renumbered after the
        strip.

        So we truncate the revlog on the first of these revisions, and
        trust that the caller has saved the revisions that shouldn't be
        removed and that it'll re-add them after this truncation.
        iNi(R2R}RRtRRYRzR/RXR6R\R~R}RR:RBR9(R0RvR7RDRRR!((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytstrips"			
cC@sd}t|r7td|jt|d}nyF|j|j}|jdd|j}|j||}Wn1tk
r}|j	t	j
krnd}nXy|j|j}|jdd|j}|j|jj
}td||}|||}|jrvd}	x*|D]"}
|	td|j|
7}	q/Wd}|t|||	}nWn1tk
r}|j	t	j
krnd}nX||fS(Niii(R2RRRZRYRttellRnRpRqRrRXRzR/RtR(R0texpectedRtactualtddRRRtdit	databytesR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	checksizes@%


	
 
cC@s,|jg}|js(|j|jn|S(N(RXRtR5RY(R0tres((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfiless	N(MRFRGt__doc__RbR1RRRRR6RRt
propertycacheR:RRRDRBRRRRRRRRRRRRR/RRRRRRRRRRRRRRRRRRRRRRRRRRR}RRRR RR$R3R<R>RGR5R\RuRSRmR}R~RR(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyROsb															
		#				@			
"		
				
	"	&			$(		
	3		3%			g			(	(	%iii(=Rt
__future__RRRqRRfR,R$RBRRRRti18nRRPRRRR	R
RtpackR@RoR3R>RAR*R#RvRwRsRhtREVLOG_DEFAULT_FLAGStREVLOG_DEFAULT_FORMATRgRxRJR6RR)RR%RRKRRRRRR R.RR+RIRMR4RHRO(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt<module>sV".					

								+