-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/revlog.pyc


\,Tc@sdZddlmZmZmZmZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZejZejZejZejZejZdZdZdZdZeZeZ e eBZ!eeBZ"dZ#d	Z$d
Z%ej&Z&ej'Z'dZ(dZ)d
Z*eeZ+dZ,dZdZ-dZ.de/fdYZ0dZ1dZ2dZ3de/fdYZ4de/fdYZ5dS(sStorage back-end for Mercurial.

This provides efficient delta storage with O(1) retrieve and append
and O(changes) merge between branches.
i(tbinthextnullidtnullrev(t_NiiiiiicCst|d?S(Ni(tint(tq((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	getoffset.scCst|d@S(Ni(R(R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytgettype1scCstt|d>|BS(Ni(tlong(toffsetttype((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytoffset_type4scCsv|tkr(tj}|j|n7||g}|jt|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(Rtnullhashtcopytupdatetsortt_shatdigest(ttexttp1tp2tstl((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pythash9s

cCs|s
|S|d}|dkr$|S|dkrvyt|SWqvtjk
rr}ttdt|qvXn|dkr|dSttd|dS(	s decompress the given input ittxsrevlog decompress error: %stuisunknown compression type %rN(t_decompresstzlibterrortRevlogErrorRtstr(Rttte((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
decompressNs
#s>4l20s20s20si8trevlogoldiocBs#eZdZdZdZRS(cCstjt|_dS(N(tstructtcalcsizet
indexformatv0tsize(tself((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__init__jsc	Cs%|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'RtgettappendtNone(R)tdatatinlineRtindextnodemaptntoffRtcurR"te2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
parseindexms 	


(3
%cCs{t|dr%ttdnt|d|d|d|d||d||d|df}tt|S(	Nisindex entry flags need RevlogNGiiiiii(RRRRt_packR'(R)tentrytnodetversiontrevR7((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	packentrys
"'(t__name__t
__module__R*R8R>(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR$is		s>Qiiiiii20s12xi s>ItrevlogiocBs#eZdZdZdZRS(cCstjt|_dS(N(R%R&t
indexformatngR((R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR*scCs1tj||\}}|t|dd|fS(NR3(tparserstparse_index2tgetattrR/(R)R0R1R2tcache((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR8scCs9tt|}|dkr5tt||d}n|S(Nii(R9RBt
versionformat(R)R:R;R<R=tp((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR>s(R?R@R*R8R>(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRAs		trevlogcBs]eZdZdZdZdZdZdd<dZe	j
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZeZdedZdZd<d<dZd<d<dZd<d<dZd<d<dZ dZ!dZ"d<d<dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2d-Z3d.Z4d/Z5d0Z6d<d1Z7d<d2Z8d<d<d3Z9d4Z:d5Z;d6Z<d7Z=d8Z>d9Z?d:Z@d;ZARS(=sM
    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.
    cCs||_|d d|_||_d|_d|_d|_d|_g|_i|_	it
t6|_d|_
t}t|dd}|dk	rd|krd|kr|tO}qnd}d	|kr|d	|_qn|jdkrttd
|jn0|j|jd@r>ttd|jnd}t|_yd|j|j}|j}|jt|dkrtjt|d
 d}t|_nWn+tk
r}|jtjkrqnX||_|t @|_!|t@|_"|d@}|d@}	|	t#krN|rNttd|j|d?fnk|	t$kr|t%@rttd|j|d?fn.|	t$krttd|j|	fnt&|_'|jt#krt(|_'ny|j'j)||j!}
Wn0t*t+fk
r1ttd|jnX|
\|_}|_|dk	rf||_,|_n|js||j-ndS(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.dititoptionstrevlogv1tgeneraldeltatchunkcachesizes0revlog 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(iRJi(.t	indexfiletdatafiletopenerR/t_cachet
_basecachet_chunkcachet_chunkcachesizeR2t_pcacheRRt
_nodecachet_nodepostREVLOG_DEFAULT_VERSIONREtREVLOGGENERALDELTARRtTruet
_initemptytreadtcloseR+R%tunpackRGtFalsetIOErrorterrnotENOENTR<tREVLOGNGINLINEDATAt_inlinet
_generaldeltatREVLOGV0tREVLOGNGtREVLOGNG_FLAGSRAt_ioR$R8t
ValueErrort
IndexErrorR3t_chunkclear(R)RQROtvtoptstitftinsttflagstfmttdR3((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR*s										

	



	cCs|jt|jdS(Ni(R;R+R2(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyttipscCst|jdS(Ni(R+R2(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__len__scCsttt|S(N(titertxrangeR+(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__iter__sicCsPd}|dk	r4||kr'd}n||7}nt|}t|||S(s8iterate over all rev in this revlog (from start to stop)iiN(R/R+Ry(R)tstarttstoptstep((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrevss	
cCs|j|jd|jS(Ni(R=R;RW(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR3scCs.y|j|tSWntk
r)tSXdS(N(R=R[tKeyErrorR`(R)R;((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pythasnode$s


cCsBy|jjWn*tk
r=itt6|_d|_nXdS(N(RWtclearcachestAttributeErrorRRR/RX(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR+s

cCsy|j|SWntk
r=t||jtdntk
r|j}|j}|j}|dkrt	|d}nxOt
|ddD];}||d}|||<||kr|d|_|SqWt||jtdnXdS(Nsno nodeiiii(RWRtLookupErrorRORRR2RXR/R+Ry(R)R;R4RpRHtrRn((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR=2s"

			

cCs|j|dS(Ni(R2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR;GscCs|j|dS(Ni(R2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytlinkrevIscCs>|j}||j|}||dd||ddfS(Niii(R2R=(R)R;RpRu((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytparentsKs	cCs|j|dd!S(Nii(R2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
parentrevsOscCst|j|dd?S(Nii(RR2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR{QscCs|j||j|S(N(R{tlength(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytendSscCs|j|dS(Ni(R2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRUscCsB|j}||d}x$||kr=|}||d}qW|S(Ni(R2(R)R=R2tbase((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	chainbaseWs	cCs|j|dd@S(Nii(R2(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs^scCsC|j|d}|dkr!|S|j|j|}t|S(s?return the length of the uncompressed text for a given revisionii(R2trevisionR;R+(R)R=RR!((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrawsize`s
cCstj||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.tstoprevt	inclusive(tancestort
lazyancestors(R)R~RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	ancestorsjsccst|}|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).NR{i(tminRtsetR~Rtadd(R)R~tfirstRptseenR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytdescendantsss
	
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.tlazysetcBs5eZdZdZdZdZdZRS(cSst|_||_dS(N(Rtaddedvaluest
lazyvalues(R)R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR*scSs||jkp||jkS(N(RR(R)tvalue((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt__contains__scssK|j}x|D]}|VqWx%|jD]}||kr)|Vq)q)WdS(N(RR(R)taddedR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRzs	
	cSs|jj|dS(N(RR(R)R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscSs|jj|dS(N(RR(R)tvalues((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs(R?R@R*RRzRR(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs
				c3s!|]}|kr|VqdS(N((t.0R(thas(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pys	<genexpr>sN(R/RtheadsR=tobjectRRRRRtutiltdequetpopleftRR.tlistRR;(	R)tcommonRR4RtmissingtvisitRRH((Rs4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindcommonmissings.
""

		

cCsI|dkrtg}n|dkr3|j}ntj|||jS(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.N(R/RtheadrevsRtmissingancestorsR(R)RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindmissingrevss
cCs|dkrtg}n|dkr3|j}ng|D]}|j|^q:}g|D]}|j|^q\}gtj|||jD]}|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.N(R/RRR=RRRR;(R)RRR4R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfindmissings""cCsgggf}|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.iR{iR|N(R/RRR=RRR;RR+RtdicttfromkeysR`tmaxtpopRRRRR~R[ttupletremoveR.t	iteritemstAssertionError(R)trootsRtnonodesR4t	lowestrevRt
highestrevRt
nodestotagRHRt
orderedouttisdescendanttflag((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytnodesbetweens+	8		(	
%+	,	  
	


+cCs0y|jjSWntk
r+|jSXdS(N(R2RRt	_headrevs(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs
cCst|}|stgSdg|d}|j}x<|D]4}d||<||}d||d<||d<q:Wgt|D]\}}|r|^qS(Niiii(R+RR2t	enumerate(R)tcounttisheadR2RR"tval((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs	


cCs|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
        R{iN(R/R+RRR;RR=RR~RR(R)R{R|RR4tstoprevststartrevt	reachableRRRH((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRs,&		(	cCsg}|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 nodeR{i(R=R~RRR.R;(R)R;tcRHRtprtprevs((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytchildrens.
 cCsQ|tkrtSx:|j|gD]&}||kr9tS||kr#Pq#q#WtS(N(RR[RR`(R)R{RRp((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
descendantscCsz|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(	R=R2tcommonancestorsheadsRt
OverflowErrorRRtmapR;(R)tatbtancs((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscCs|j||j|}}y|jj||}Wn/ttfk
ritj|j||}nX|rtt|j	|St
S(s4calculate the least common ancestor of nodes a and b(R=R2RRRRRRRR;R(R)RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscCsLt|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
isinstanceRR;R+R=RR RkRRt	TypeError(R)tidR;R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_matchs6


		
cCsy3|jj|}|r.|j|r.|SdSWn'tk
rFnttfk
r\nX||jkrw|j|St|dkryt|d}t	||d }g|jD]#}|dj
|r|d^q}g|D]0}t|j
|r|j|r|^q}t|dkr{t|dkr]|d|j|<|dSt||j
tdndSWqtk
rqXndS(Ni(iiiisambiguous identifier(R2tpartialmatchRR/RRRkRVR+Rt
startswithRRRORR(R)RR4RtprefixR"tnl((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
_partialmatchs6
3"
cCsW|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(RR/RRROR(R)RR4((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytlookup<scCs+|j|\}}t||||kS(spcompare text with a given file revision

        returns True if text is different than what is stored.
        (RR(R)R;RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytcmpJscCsj|j\}}|t||krWt|t|tkrW|||f|_n||f|_dS(N(RTR+t
_chunksize(R)R
R0toRu((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_addchunkRs2cCs|jr|j|j}n|j|j}|j}||d@}||||d@|}|j||j|}|j|j||||ks||krt	j
||||S|S(Ni(ReRQRORPRUtseekR]R^RRtbuffer(R)R
Rtdft	cachesizet
realoffsett
reallengthRu((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
_loadchunkZs		

cCs|j\}}t|}||}||}|dkrz||krz|dkrc||krc|Stj||||S|j||S(Ni(RTR+RRR(R)R
RRRuRt
cachestarttcacheend((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_getchunkos

cCst|j|}|j|}|jrZ||d|jj7}||d|jj7}n||}|j||S(Ni(R{RReRjR(R(R)RtendrevR{RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	_chunkraw}s	
cCst|j||S(N(R#R(R)R=((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_chunkscCs3|s
gS|j}|j}|j}|jj}tj}g}|j}yQx>tr|j	}	|j
|d|d|	|j	krOPqOqOW|	\}
}Wn.tk
rg|D]}|j|^qSXxa|D]Y}||}
|r|
|d|7}
n||}|t
|||
|
|qW|S(sffaster version of [self._chunk(rev) for rev in revs]

        Assumes that revs is in ascending order.iii(R{RReRjR(RRR.R[RTRRRR#(R)R~R{RR1tiosizeRRtladdRRR
R0R=t
chunkstarttchunklength((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt_chunkss2							
!
$cCs
d|_dS(NiRJ(iRJ(RT(R)((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRmscCs:|j|d}||kr!tS|jr.|S|dSdS(s(return deltaparent of the given revisioniiN(R2RRf(R)R=R((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytdeltaparents	cCsV|tkr4|j||kr4t|j|Stj|j||j|S(s1return or calculate a delta between two revisions(RRR RtmdiffttextdiffR(R)trev1trev2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytrevdiffs!c
Cs	t|tr'|}|j|}n|}d}|j}d}|tkrRdS|r}|d|krp|dS|d}nd}|dkr|j|}n|j|t@rt	t
d|j|t@ng}|j}|j}	|}
||
}xT|
|dkrZ|
|krZ|j
|
|	rC|d}
n
|
d8}
||
}qW|
|krt|d}n
|j
|
|jd|_|j|}|dkrt|d}|d}ntj||}|j|||}|||f|_|S(sTreturn an uncompressed revision of a given node or revision
        number.
        RJiiisincompatible revision flag %xiN(RRR;R/RRRR=RstREVIDX_KNOWN_FLAGSRRR2RfR.treverseRR Rtpatchest
_checkhash(
R)t	nodeorrevR=R;RRt	cachedrevRtchainR2RMtiterrevR"tbins((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRsV	
		






	
cCs2|j|\}}|j||||||S(N(Rt	checkhash(R)RR;R=RR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRscCsh|t|||krd|}|dkrBtjt|}nttd|j|fndS(Nsintegrity check failed on %s:%s(RR/ttemplatefilterstshortRRRRO(R)RRRR;R=t	revornode((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRsc
Cs|js,|jd|jdtkr0dS|j|j}|dkrjttd|jn|d}|j|}|j	|j
||r|j|jn|j
|j
d}z.x'|D]}|j|j||qWWd|jX|j
|jddt}|jtM_t|_xC|D];}|jj|j||j|j|}	|j|	q?W|j|j|j||jj|jdS(Nis%s not found in the transactionitwt
atomictemp(ReR{Rt
_maxinlinetfindROR/RRRRPtflushR^RQtwriteRR[R<RdR`RjR>R2R;treplaceR(Rm(
R)ttrtfpttrinfottrindextdataoffRRRpR"((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytcheckinlinesizes4,



!	
(
c

Cs|tkr(ttd|jn|p=t|||}||jkrS|Sd}|jsz|j|j	d}n|j|jd}	z)|j
||||||||	|	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 %sRsa+N(RRRRORR3R/ReRQRPt_addrevisionR^(
R)RttransactiontlinkRRt
cachedeltaR;tdfhtifh((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytaddrevision:s 
	
cCs0|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 RJi,i@BiiiRRNi(R+R/RtcompressobjR.tcompressRtsumRtjoint	_compress(R)RRRtzRHtpostpos2((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRZs.




c
s|g	
fd
fd}
t
}|d}|}
}
j|d}d}
jdkr|
j|f
_n
j
j
j	}}|tkr[
jr7|dkr	|
|}qC|dkr(|
|}qC|
|}n|
|}|\}}}}
}n|dkrtj	
j
dd}nt|}|dks||dkr}
j|}t|dt|d}|}
}nt||||
|||f}
j
jd||
j<
jj|
j
j|}
j||||t|tkr||f
_n||f
_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.
        csddk	rdSr+jnjjjd}tj|dd<jddS(Nii(R/RRR;RtpatchR(tbasetext(tbtextRRRR;RRR)(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	buildtexts

c	sr#d|kr#d}n3}jj|}tj||}j|}t|dt|d}d|krd}nj|}|j|}jr|}n|}|||||fS(Nii(	RR;RRRR+RR{Rf(	R=tdeltaR!tptextR0RRtdistR(t	basecacheR&RR
R)(s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
builddeltas
	
		iiiiN(R+RR/RSRR=RRfRtpatchedsizeRRRR2tinsertR3RjR>R;R<t_writeentryRR RR(R)R;RRRRRRRRR+tcurrtprevRRRsRutp1rtp2rR)RR0ttextlenR"R:((R*R%R&RRRR;R
RRR)s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRwsR		$

			

!c	Cst|d}|js|j|j||j|j|t||drg|j|dn|j|d|j|j|ni|||jj7}|j|j|||j||j|d|j|d|j	||dS(Nii(
R+ReRRPRORRRjR(R(	R)RRRR:R0RR
R/((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyR.s	


c
Csg}d
}t|}d}|r:|j|d}n|j|jd}||jj}	|jr|j|j||	|d
}
n>|j|j|	||j|j	||j|j	d}
zd
}xt
r\|j|}|sPn|d}|d}
|d}|d}|d	}|d
}|j|||}||j
krd|}qnxA|
|fD]3}||j
krqt||jtdqqqqW||j
krt||jtdn|j|}|j|d
|||
|||f||
	}|
r|jr|j|j|j	d}
|j|jd}qqWWd
|
rt|
jn|jX|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.
        iisa+RR;RRtcst	deltabaseR'sunknown parentsunknown delta baseN(R/R+RRQRORjR(ReRRPR[t
deltachunkR.R3RRR=RR^(R)tbundlet
linkmapperRtcontentR;RRRtisizeRRt	chunkdataRRR4R5R'RRHtbaserev((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytaddgroupsb
			







 
cCs'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(	RR+RRRRRRR(R)tminlinkt
brokenrevst
strippointRtfuturelargelinkrevstheadtheadlinkrevRRHtplinkrev((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt
getstrippoint0s,		
	


cCst|dkrdS|j|\}}|t|krAdS|j|}|js|j|j|||jj}n|||jj7}|j|j|d|_
|jx0t|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(R+RER{ReRRPRjR(ROR/RRRmRyR3R;R2(R)R>RR=RRR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytstripXs 		
cCsd}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(R+RRRQRPRttellR^RaRbRcRORjR(ReR(R)texpectedRqtactualtddRrRRptdit	databytesR((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt	checksizes@%


	
 
cCs,|jg}|js(|j|jn|S(N(ROReR.RP(R)tres((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pytfiless	N(BR?R@t__doc__R*RvRwRzR/R~Rt
propertycacheR3RRR=R;RRRR{RRRRsRR(R`RRRRRRRRRRRRRRRRRRRRRRRRmRRRRRRRRRR.R=RERFRMRO(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyRIsz	N																		@		
"		
			
	"	#									&		
		B	'		]		J	(	'	%ii(6RPR;RRRRti18nRRRRCRRRR%RRbtpackR9R_R,RRR#Rtsha1RRgRhRdRZtREVLOG_DEFAULT_FLAGStREVLOG_DEFAULT_FORMATRYRiRR	RRRRRRR
RR'tv0shaoffsetRR$RBtngshaoffsetRGRARI(((s4/usr/lib/python2.7/dist-packages/mercurial/revlog.pyt<module>sH"H$					

							+

Copyright © 2017 || Recoded By Mr.Bumblebee