HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //usr/lib64/python2.7/site-packages/mercurial/revlog.pyo
�
1�3\c@@s�dZddlmZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)dd	l*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3dd
l4m5Z6ddl7m8Z8m9Z9m:Z:e e!e#eee%e&e'e"e$eeeeeeee/j;d�Z<ej=Z>d
Z?dZ@ide6ZBd�ZCd�ZDd�ZEeCeDeEfZFd�ZGd�ZHd�ZId�ZJd�ZKe)jLdeMdeM�deNfd��Y�ZOe8jPe1jQ�e)jLdeM�deNfd��Y��ZRe8jPe1jS�e)jLdeM�deNfd��Y��ZTejUd�ZVeVjWZXeVjYZZd e[fd!��YZ\d"eNfd#��YZ]ejUd$�Z^e^jWZ_ejUd%�Z`e`jWZae`jYZbd&Zcd'eNfd(��YZdd)eNfd*��YZedS(+s�Storage back-end for Mercurial.

This provides efficient delta storage with O(1) retrieve and append
and O(changes) merge between branches.
i(tabsolute_importNi(
tbinthextnullhextnullidtnullrevtshorttwdirfilenodeidstwdirhextwdiridtwdirrev(t_(tFLAG_GENERALDELTAtFLAG_INLINE_DATAtREVIDX_DEFAULT_FLAGStREVIDX_ELLIPSIStREVIDX_EXTSTOREDtREVIDX_FLAGS_ORDERtREVIDX_ISCENSOREDtREVIDX_KNOWN_FLAGStREVIDX_RAWTEXT_CHANGING_FLAGStREVLOGV0tREVLOGV1tREVLOGV1_FLAGStREVLOGV2tREVLOGV2_FLAGStREVLOG_DEFAULT_FLAGStREVLOG_DEFAULT_FORMATtREVLOG_DEFAULT_VERSION(tattr(	tancestortdagopterrortmdifftpolicytpycompatt
repositoryttemplatefilterstutil(tdeltas(t
interfaceutiltstorageutilt
stringutiltparsersiicC@s
|tfS(N(tFalse(trlttext((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytellipsisreadprocessorrscC@s
|tfS(N(R,(R-R.((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytellipsiswriteprocessoruscC@stS(N(R,(R-R.((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytellipsisrawprocessorxscC@st||t�dS(s!Register a flag processor on a revision data flag.

    Invariant:
    - Flags need to be defined in REVIDX_KNOWN_FLAGS and REVIDX_FLAGS_ORDER,
      and REVIDX_RAWTEXT_CHANGING_FLAGS if they can alter rawtext.
    - Only one flag processor can be registered on a specific flag.
    - flagprocessors must be 3-tuples of functions (read, write, raw) with the
      following signatures:
          - (read)  f(self, rawtext) -> text, bool
          - (write) f(self, text) -> rawtext, bool
          - (raw)   f(self, rawtext) -> bool
      "text" is presented to the user. "rawtext" is stored in revlog data, not
      directly visible to the user.
      The boolean returned by these transforms is used to determine whether
      the returned text can be used for hash integrity checking. For example,
      if "write" returns False, then "text" is used to generate hash. If
      "write" returns True, that basically means "rawtext" returned by "write"
      should be used to generate hash. Usually, "write" and "read" return
      different booleans. And "raw" returns a same boolean as "write".

      Note: The 'raw' transform is used for changegroup generation and in some
      debug commands. In this case the transform only indicates whether the
      contents can be used for hash integrity checks.
    N(t_insertflagprocessort_flagprocessors(tflagt	processor((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytaddflagprocessor�scC@s�|t@s,td�|}tj|��n|tkrZtd�|}tj|��n||kr�td�|}tj|��n|||<dS(Ns0cannot register processor on unknown flag '%#x'.s+flag '%#x' undefined in REVIDX_FLAGS_ORDER.s2cannot register multiple processors on flag '%#x'.(RRR tProgrammingErrorRtAbort(R4R5tflagprocessorstmsg((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR2�s
cC@st|d?�S(Ni(tint(tq((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt	getoffset�scC@st|d@�S(Ni��(R;(R<((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytgettype�scC@s8|t@dkr td��ntt|�d>|B�S(Nisunknown revlog index flagsi(Rt
ValueErrorR;(toffsetttype((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytoffset_type�stslotstfrozent
_revisioninfocB@sbeZdZej�Zej�Zej�Zej�Zej�Z	ej�Z
ej�ZRS(s~Information about a revision that allows building its fulltext
    node:       expected hash of the revision
    p1, p2:     parent revs of the revision
    btext:      built text cache consisting of a one-element list
    cachedelta: (baserev, uncompressed_delta) or None
    flags:      flags associated to the revision storage

    One of btext[0] or cachedelta must be set.
    (t__name__t
__module__t__doc__Rtibtnodetp1tp2tbtextttextlent
cachedeltatflags(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRE�s
trevlogrevisiondeltacB@szeZej�Zej�Zej�Zej�Zej�Zej�Z	ej�Z
ej�Zejdd�Z
RS(tdefaultN(RFRGRRIRJtp1nodetp2nodetbasenodeRPtbaserevisionsizetrevisiontdeltatNonetlinknode(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRQ�st
revlogproblemcB@s>eZejdd�Zejdd�Zejdd�ZRS(RRN(RFRGRRIRYtwarningR RJ(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR[�ss>4l20s20s20strevlogoldindexcB@seZd�ZRS(cC@s8|dkr(dddddddtfStj||�S(Ni����i(Rtlistt__getitem__(tselfti((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR_�s(RFRGR_(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR]�strevlogoldiocB@s#eZd�Zd�Zd�ZRS(cC@stj|_dS(N(t
indexformatv0tsize(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt__init__�sc	C@s|j}g}itt6}d}}t|�}x�|||kr�||||!}	||7}t|	�}
t|
dd�|
dd|
d|
d|j|
dt�|j|
dt�|
df}|j|�|||
d<|d7}q5Wt|�|dfS(	Niii����iiiii(
RdRRtlentindexformatv0_unpackRBtgettappendR]RY(R`tdatatinlinetstindextnodemaptntofftltcurtete2((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
parseindex�s	


(3
cC@s{t|d�r(tjtd���nt|d�|d|d|d||d�||d�|df}t|�S(	Nis'index entry flags need revlog version 1iiiiii(R>R tRevlogErrorRR=tindexformatv0_pack(R`tentryRJtversiontrevRt((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt	packentrys
"'(RFRGReRuR{(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRb�s		s>Qiiiiii20s12xs>Ii���trevlogiocB@s#eZd�Zd�Zd�ZRS(cC@stj|_dS(N(t
indexformatngRd(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRe scC@s1tj||�\}}|t|dd�|fS(NRn(R+tparse_index2tgetattrRY(R`RjRkRmtcache((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRu#scC@s3t|�}|dkr/t|�|d}n|S(Nii(tindexformatng_packtversionformat_pack(R`RxRJRyRztp((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR{(s(RFRGReRuR{(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR|s		trevlogcB@seZdZd`eeed�Zd�Zejd��Z	dd�Z
dd�Zej
d`d��Zd�Zd	�Zd
�Zd�Zdd`d
�Zejd��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z e Z!d�Z"d�Z#d�Z$d�Z%d�Z&d`d �Z'ded!�Z(d"�Z)d`d`d#�Z*d`d$�Z+d`d`d%�Z,d`d`d&�Z-d`d`d'�Z.d(�Z/d)�Z0d*�Z1d`d`d+�Z2d,�Z3d-�Z4d.�Z5d/�Z6d0�Z7d1�Z8d2�Z9d3�Z:d4�Z;d5d6�Z<d7�Z=d8�Z>d`d9�Z?d`d:�Z@d`d;�ZAd`d<�ZBd`d`d=�ZCd>�ZDd?�ZEd@�ZFdA�ZGdB�ZHd`edC�ZIdD�ZJedE�ZKd`d`d`dF�ZLd`dG�ZMdH�ZNd`d`eOd`dI�ZPd`d`dJ�ZQdK�ZRdL�ZSed`dM�ZTdN�ZUd`dO�ZVdP�ZWdQ�ZXdR�ZYdS�ZZdT�Z[dU�Z\d`eeedV�Z]dWZ^dXZ_dYZ`dZZadWdXdYdZhZbd`e_d`d[�Zcd\d]�Zdd^�Zeeeeeed_�ZfRS(as�
    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.

    If mmaplargeindex is True, and an mmapindexthreshold is set, the
    index will be mmapped rather than read if it is larger than the
    configured threshold.

    If censorable is True, the revlog can have censored revisions.
    c
C@su||_|p|d d|_||_||_||_d|_tjd�|_	d |_
d|_d|_t
|_g|_i|_itt6|_d|_d|_d|_t|_t|_d	|_d
|_tt�|_d}t}t|dd�}	|	dk	rd|	kr1t t!Bt"B}n.d
|	krYd|	kr_|t!O}q_nd}d|	kr{|	d|_nd|	kr�|	d|_nd|	kr�|	d|_nt#|	j$dt��|_%d|	kr�|	d|_nd|	kr|	d|_n|r%d|	kr%|	d}nt#|	j$dt��|_t#|	j$dt��}
|jpd|
|_d|	kr�|	d|_nd|	kr�|	d|_n|	j$d�r�t&|jt'<nx<|	j$di�j(�D]\}}t)|||j�q�Wn|jdkr.t*j+t,d�|j��n3|j|jd@rat*j+t,d�|j��n|j-||�dS(!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.
        i����s.didititzlibi����g�?itoptionstrevlogv2trevlogv1tgeneraldeltatchunkcachesizetmaxchainlentdeltabothparentst
lazydeltabaset
compenginetmaxdeltachainspantmmapindexthresholds
sparse-revlogswith-sparse-readssparse-read-density-thresholdssparse-read-min-gap-sizetenableellipsisR9s0revlog chunk cache size %r is not greater than 0is.revlog chunk cache size %r is not a power of 2N(iR�(.t	indexfiletdatafiletopenert_checkambigt_censorableRYt_revisioncacheR&tlrucachedictt_chainbasecachet_chunkcachet_chunkcachesizet_maxchainlentTruet_deltabothparentsRmt_pcacheRRt
_nodecachet_nodepost_compenginet_maxdeltachainspanR,t_withsparsereadt
_sparserevlogt_srdensitythresholdt
_srmingapsizetdictR3RRRRR
tboolRht_lazydeltabasetellipsisprocessorRt	iteritemsR2R RvRt
_loadindex(
R`R�R�R�t
checkambigtmmaplargeindext
censorableR�tvtoptstwithsparsereadR4R5((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRePs~																		
%c
C@s�d}t|_y�|j��U}|dk	rc|jj|�j|krctjtj	|��}n|j
�}WdQXt|�dkr�t|d �d}t
|_nWn+tk
r�}|jtjkr��q�nX||_|t@|_|t@|_|d	@}|d@}|tkrN|r�tjtd�|d?||jf��q�n�|tkr�|t@r�tjtd�|d?||jf��q�nh|tkr�|t@r�tjtd�|d?||jf��q�n"tjtd�||jf��t|_t �|_!|jtkr/t"�|_!ny|j!j#||j�}Wn3t$t%fk
r�tjtd�|j��nX|\|_&}	|_'|	dk	r�|	|_(|_)n|j's�|j*�ni|_+i|_,dS(
NR�iii��s-unknown flags (%#04x) in version %d revlog %sis!unknown version (%d) in revlog %ssindex %s is corruptedi��(-R�t
_initemptyt_indexfpRYR�tfstattst_sizeR&tbuffertmmapreadtreadRftversionformat_unpackR,tIOErrorterrnotENOENTRyR
t_inlineRt
_generaldeltaRR RvRR�RRRRt_storedeltachainsR|t_ioRbRuR?t
IndexErrorRmR�RnR�t_chunkcleart_chaininfocachet_decompressors(
R`R�R�t	indexdatatftinstRPtfmttdRn((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��sb	
	



   		
	cC@stj|jj�S(N(R&tcompenginesR�trevlogcompressor(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_compressor�strcC@sUi|d6}|dkr)|j|d<n|dkrBt|d<n|j|j|�S(s'file object for the revlog's index filetmodeR�R�twt
atomictemp(R�R�R�R�(R`R�targs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s

cC@s|j|jd|�S(s&file object for the revlog's data fileR�(R�R�(R`R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_datafp�scc@sM|dk	r|Vn5|jr)|j}n	|j}|��}|VWdQXdS(s!file object suitable to read dataN(RYR�R�R�(R`t
existingfptfunctfp((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_datareadfp�s		cC@s|jt|j�d�S(Ni(RJRfRm(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyttipscC@sd|kot|�kSS(Ni(Rf(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt__contains__scC@s
t|j�S(N(RfRm(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt__len__
scC@sttjt|���S(N(titerR#txrangeRf(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt__iter__sicC@stjt|�d|d|�S(s8iterate over all rev in this revlog (from start to stop)tstarttstop(R)titerrevsRf(R`R�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytrevsscC@s1|jr*|jdd}|j|�n|jS(Nii(RmRzR�(R`tnode0((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRns	cC@s.y|j|�tSWntk
r)tSXdS(N(RzR�tKeyErrorR,(R`RJ((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pythasnodes


cC@s.|j|�t@s&|j|�t@r*tStS(s;whether two revisions (baserev, rev) can be delta-ed or not(RPRR,R�(R`tbaserevRz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytcandelta!scC@sjd|_|jj�d|_i|_y|jj�Wn*tk
reit	t
6|_d|_nXdS(NiR�(iR�(RYR�R�tclearR�R�R�tclearcachestAttributeErrorRRR�(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�-s	
		
cC@s`y|j|SWnJtk
r%�n7tjk
rz|tksM|tkrYtj�ntj||jt	d���n�t
k
r[|j}|j}|j}|dkr�t|�d}nxRtj|dd�D];}||d}|||<||kr�|d|_|Sq�W|tks.|tkr:tj�ntj||jt	d���nXdS(Nsno nodeii����i(R�t	TypeErrorR RvR	RtWdirUnsupportedtLookupErrorR�RR�RmR�RYRfR#R�(R`RJRoRaR�R�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRz9s.
!
			

cC@st|j|dd?�S(Nii(R;Rm(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�ZscC@s|j|dd@S(Nii��(Rm(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRP]scC@s|j|dS(Ni(Rm(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytlength`scC@s@|j|d}|dkr!|S|j|dt�}t|�S(s?return the length of the uncompressed text for a given revisioniitraw(RmRWR�Rf(R`RzRqtt((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytrawsizecs
cC@sI|j|�}|ttA@dkr0|j|�St|j|dt��S(s=length of non-raw text (processed by a "read" flag processor)iR�(RPRRR�RfRWR,(R`RzRP((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRdls
cC@sw|jj|�}|dk	r"|S|j}|}||d}x$||kre|}||d}qBW||j|<|S(Ni(R�RhRYRm(R`RztbaseRmtiterrev((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt	chainbasevs	
cC@s|j|dS(Ni(Rm(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytlinkrev�scC@sRy|j|}Wn,tk
r?|tkr9tj�n�nX|d|dfS(Nii(RmR�R
R R�(R`RzRx((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
parentrevs�s
cC@sFy|j|dSWn,tk
rA|tkr;tj�n�nXdS(Ni(RmR�R
R R�(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRJ�s
cC@s|j|�|j|�S(N(R�R�(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytend�scC@s>|j}||j|�}||dd||ddfS(Niii(RmRz(R`RJRaR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytparents�s	cC@s|j|�dS(Ni(t
_chaininfo(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytchainlen�scC@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�RmR�(R`RztchaininfocacheRmR�R�RstclentcompresseddeltalenR�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s2			





c	C@s�y|jj|||j�SWntk
r0nXg}|j}|j}|}||}xT||dkr�||kr�|j|�|r�|d}n
|d8}||}q\W||kr�t}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(Rmt
deltachainR�R�RiR�R,treverse(	R`RztstoprevtchainRmR�R�Rststopped((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_deltachain�s*
		



	

cC@s�t|�}|j}x|D]}||�qWtjtd�ratj|j|d|d|�Stj|j	|d|d|�S(s�Generate the ancestors of 'revs' in reverse topological order.
        Does not generate revs lower than stoprev.

        See the documentation for ancestor.lazyancestors for more details.trustlazyancestorsRt	inclusive(
R^RJR&tsafehasattrR+RRRmt
lazyancestorst_uncheckedparentrevs(R`R�RRtcheckrevR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt	ancestors�s	

cC@stj||j|j�S(N(RtdescendantrevsR�R�(R`R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytdescendantssc
@s�|dkrtg}n|dkr3|j�}ng|D]}|j|�^q:}g|D]}|j|�^q\}dtfd��Y}||j|����jt��j|�t	�}t
j�fd�|D��}xk|rQ|j�}||krq�q�|j|�x3|j
|�D]"}|�kr(|j|�q(q(Wq�Wt|�}|j��g|D]}	|j|	�^qrfS(s�Return 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@s5eZd�Zd�Zd�Zd�Zd�ZRS(cS@st�|_||_dS(N(tsettaddedvaluest
lazyvalues(R`R((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRescS@s||jkp||jkS(N(RR(R`tvalue((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�#scs@sK|j}x|D]}|VqWx%|jD]}||kr)|Vq)q)WdS(N(RR(R`taddedR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�&s	
	cS@s|jj|�dS(N(Rtadd(R`R((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR.scS@s|jj|�dS(N(Rtupdate(R`tvalues((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR1s(RFRGReR�R�RR(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs
				c3@s!|]}|�kr|VqdS(N((t.0R�(thas(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pys	<genexpr>:sN(RYRtheadsRztobjectRRRRRtcollectionstdequetpopleftR�RiR^tsortRJ(
R`tcommonRRoRtmissingtvisitR�R�tmiss((Rs6/usr/lib64/python2.7/site-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(RYRRtincrementalmissingancestorsR�(R`R((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytincrementalmissingrevsHs	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(RYRtheadrevsR%tmissingancestors(R`RRtinc((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytfindmissingrevsVscC@s�|dkrtg}n|dkr3|j�}ng|D]}|j|�^q:}g|D]}|j|�^q\}|jd|�}g|j|�D]}|j|�^q�S(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(RYRRRzR%R'RJ(R`RRRoR(R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytfindmissingns""cC@s�gggf}|dk	r\t|�}|s1|Stg|D]}|j|�^q;�}ntg}t}|tkr�|dkr�g|D]}|j|�^q�tgt|j��fS|dkr�t|�d}d}i}n�t|�}|s�|St	�}t
j|t�}t	|�}	t
g|	D]}|j|�^q-�}x�|	r|	j�}|tkrrqNn|j|�}||krN||kr�|j|�|	jg|j|�D]}
|
tkr�|
^q��q�||kr�|j|�q�qNqNW|s|S|tkrtg|D]}||kr|^q}|rmtg|D]}|j|�^qL�}q�|Snt}tg}t	|�}|j�}g}
x�|jdt
|d�d|d�D]z}|j|�}t}|tkr�t}n�||kr`t}||kr�t|j|��}
|
d|ksJ|
d|kr]|j|�q]q�nKt|j|��}
|
d|ks�|
d|kr�|j|�t}n|r�|dks�||kr�|
j|�|dk	r�||kr�t||<qA|dkrAt||<x*|j|�D]}
|j|
d�q!WqAq�q�Wg|j�D]\}}|rR|^qR}t|�}|
||fS(s�Return 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(RYR^tminRzRRRJRRfRR�tfromkeysR,tmaxtpopRRR�tcopyR�R�ttupletremoveRiR�(R`trootsRtnonodesRot	lowestrevR�t
highestrevRt
nodestotagR�trootR
t
orderedouttisdescendanttheadR4((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytnodesbetween�s�+	8		(	
%+	,	  
	


+cC@s0y|jj�SWntk
r+|j�SXdS(N(RmR&R�t	_headrevs(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR&#s
cC@s|jj|�S(N(Rmtcomputephasesmapsets(R`R2((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
computephases)scC@s�t|�}|stgSdg|d}|j}x<|D]4}d||<||}d||d<||d<q:Wgt|�D]\}}|r|^qS(Niiii(RfRRmt	enumerate(R`tcounttisheadRmR�Rstval((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR<,s	


c@s�|dkrQ|dkrQt��s+tgSg�j�D]}�j|�^q8S|dkrft}n�j|�}t�fd�|p�gD��}tj	�j
�jd|d|�}g|D]}�j|�^q�S(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
        c3@s|]}�j|�VqdS(N(Rz(RRo(R`(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pys	<genexpr>KststartrevtstoprevsN(RYRfRR&RJRRzRRtheadrevssubsetR�R�(R`R�R�R�RDR�Rz((R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR9s&	"	cC@s�g}|j|�}x�|jd|d�D]�}g|j|�D]}|tkrB|^qB}|r�x[|D]+}||krm|j|j|��qmqmWq,|tkr,|j|j|��q,q,W|S(s!find the children of a given nodeR�i(RzR�R�RRiRJ(R`RJtcR�R�tprtprevs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytchildrenRs.
 cC@sD|j|�|j|�}}|j||�}tj|j|�S(s@calculate all the heads of the common ancestors of nodes a and b(Rzt_commonancestorsheadsR#tmaplistRJ(R`tatbtancs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytcommonancestorsheads`scG@sIy|jj|�}Wn,ttfk
rDtj|j|�}nX|S(s7calculate all the heads of the common ancestors of revs(RmROR�t
OverflowErrorRR�(R`R�RN((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRJfs
cC@s/|j|�|j|�}}|j||�S(sgreturn True if node a is an ancestor of node b

        A revision is considered an ancestor of itself.(Rzt
isancestorrev(R`RLRM((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
isancestornscC@sF|tkrtS||kr tS||kr0tS||j||�kS(s�return True if revision a is an ancestor of revision b

        A revision is considered an ancestor of itself.

        The implementation of this is trivial but the use of
        commonancestorsheads is not.(RR�R,RJ(R`RLRM((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRQuscC@s�|j|�|j|�}}y|jj||�}Wn/ttfk
ritj|j||�}nX|r�tt|j	|��St
S(s5calculate the "best" common ancestor of nodes a and b(RzRmRR�RPRR�R+tmapRJR(R`RLRMRN((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�scC@sPt|t�r|j|�St|�dkrcy|}|j|�|SWqctjk
r_qcXny|t|�}d||kr�t�n|dkr�t|�|}n|dks�|t|�kr�t�n|j|�SWnttfk
r�nXt|�dkrLy!t	|�}|j|�|SWqLt
tjfk
rHqLXndS(Nis%dii((t
isinstanceR;RJRfRzR R�R?RPRR�(R`tidRJRz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_match�s6

		
c	C@s?tj|�}yW|jj|�}|rO|j|�rO|rKtj�n|S|ratj�ndSWn]tjk
r�t	|dd�s�tj
||jtd���q�nt
tfk
r�nX||jkr�|j|St|�dkr;y2t|�d}t||d �}g|jD]#}|dj|�r#|d^q#}g|D]0}t|�j|�rS|j|�rS|^qS}tj|�r�|jt�nt|�dkr
t|�dkr�|r�|d|j|<|dStj
||jtd���n|rtj�ndSWq;tk
r7q;XndS(Ntfilteredrevssambiguous identifieri(iiii(Rt
startswithRmtpartialmatchR�R RvR�RYRtAmbiguousPrefixLookupErrorR�RR�R?R�RfRRRRiRR�(	R`RUt	maybewdirtpartialRqtprefixRstnlRo((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
_partialmatch�sL3"
cC@sZ|j|�}|dk	r|S|j|�}|r8|Stj||jtd���dS(s�locate a node based on:
            - revision number or str(revision number)
            - nodeid or subset of hex nodeid
        sno match foundN(RVRYR_R R�R�R(R`RURo((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytlookup�sic@sL�fd�}d��t|�}�fd�}t�dd�s�y,t�jj|�|�}|||�SWq�tjk
r�|tkr�tj	|�j
td���q�q�tk
r�q�Xn|tkrx4t
|d�D] }|| }||�r�|Sq�Wnx:t
|d�D])}|| }||�r|||�SqWdS(s7Find the shortest unambiguous prefix that matches node.c@spy�j|�}Wn)tjk
r*tStjk
r>tSX|dkrltj|�jt	d���ntS(Nsno node(
R_R RZR,R�R�RYR�R�R(R]RJ(R`(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytisvalid�s!cS@std�|D��S(Ncs@s|]}|dkVqdS(R�N((RRF((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pys	<genexpr>s(tall(R]((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR[sc@s8x1t|d�D] }|| }�|�s|SqWdS(sDisambiguate against wdirid.i)N(trange(thexnodet	minlengthR�R](R[(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytdisambiguates
RWsno nodei)N(RRRYR-RmtshortestR RvR	R�R�RR�Rc(R`RJReRaRdRfR�R]((R[R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRg�s,	$


cC@s.|j|�\}}tj|||�|kS(spcompare text with a given file revision

        returns True if text is different than what is stored.
        (R�R)thashrevisionsha1(R`RJR.RKRL((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytcmp#scC@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�Rft
_chunksize(R`R@RjtoR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
_cachesegment+s2cC@s�|j}||d@}||||d@|}|j|��#}|j|�|j|�}WdQX|j||�||ks�||kr�tj||||�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(R�R�tseekR�RlR&R�(R`R@R�tdft	cachesizet
realoffsett
reallengthR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_readsegment7s	
c	C@s�|j\}}t|�}||}||}|dkrz||krz|dkrc||krc|Stj||||�S|j||d|�S(s�Obtain 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.
        iRn(R�RfR&R�Rr(	R`R@R�RnRkR�Rqt
cachestarttcacheend((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_getsegmentQs

c
C@s�|j}||}t|dd?�}||krD||d}n&||}t|dd?�|d}|jr�||d|jj7}||d|jj7}n||}	||j||	d|�fS(s�Obtain 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.
        iiiRn(RmR;R�R�RdRu(
R`RCtendrevRnRmtistartR�R�tiendR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_getsegmentforrevsis	

	
cC@s#|j|j||d|�d�S(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.
        Rni(t
decompressRy(R`RzRn((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_chunk�s	cC@s�|s
gS|j}|j}|j}|jj}tj}g}	|	j}
|js^|f}nt	j
||d|�}x|D]
}|d}
x1|ddd�D]}||�dkr�Pq�q�Wy"|j|
|d|�\}}Wn4tk
rg|D]}|j
|d|�^q�SX|j}xa|D]Y}||�}|rW||d|7}n||�}|
||||||���q*Wq}W|	S(s�Obtain 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.
        t
targetsizeiNi����Rni(R�R�R�R�RdR&R�RiR�t	deltautilt
slicechunkRyRPR{Rz(R`R�RnR|R�R�RktiosizeR�Rqtladdtslicedchunkst	revschunktfirstrevtlastrevR@RjRztdecompt
chunkstarttchunklength((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_chunks�s<
							

"
'	
(cC@s
d|_dS(sClear the raw chunk cache.iR�N(iR�(R�(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��scC@s:|j|d}||kr!tS|jr.|S|dSdS(s(return deltaparent of the given revisioniiN(RmRR�(R`RzR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytdeltaparent�s	cC@sg|tkrtS|j|�}|tkr/tS|j|�\}}|||fkrZtS|j|�S(s(tells whether rev is a snapshot
        (RR�R�R�R,t
issnapshot(R`RztdeltapRKRL((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��scC@s<|j|�s!tjd��nt|j|�d�dS(s/number of snapshot in the chain before this onesrevision %d not a snapshotii(R�R R7RfR(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
snapshotdepth�scC@sb|tkr4|j|�|kr4t|j|��Stj|j|dt�|j|dt��S(s�return or calculate a delta between two revisions

        The delta calculated is in binary form and is intended to be written to
        revlog data directly. So this function needs raw revision data.
        R�(RR�tbytesR{R!ttextdiffRWR�(R`trev1trev2((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytrevdiff�s!cC@stt|t�r'|}|j|�}n|}d}d}d}d}|tkrUdS|jr�|jd|kr�|r�|jdS|dkr�|j|�}n|dkr�|j|�}n|tkr�|jdS|jd}n|jd}n|dkr�|dkr|j|�}n|j	|d|�\}	}
|
rP|jd}nd|_d}|j
|d}d|kr�d|}n|j|	d|d|�}
|dkr�t|
d�}|
d}
nt
j||
�}|||f|_n|dkr0|dkr|j|�}n|j|�}n|j||d	d
|�\}}|rp|j||d|�n|S(
swreturn an uncompressed revision of a given node or revision
        number.

        _df - an existing file handle to read from. (internal-only)
        raw - an optional argument specifying if the revision data is to be
        treated as raw data when applying flag transforms. 'raw' should be set
        to True when generating changegroups or in debug commands.
        R�iiiRiRnR|R�R�RzN(RTR;RJRYRR�RzRPRRRmR�R�R!tpatchest
_processflagst	checkhash(R`t	nodeorrevt_dfR�RzRJt	cachedrevRPtrawtextRRR|R�tbinsR.tvalidatehash((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRW�s^			

!cC@stj|||�S(syCompute a node hash.

        Available as a function so that subclasses can replace the hash
        as needed.
        (R)Rh(R`R.RKRL((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pythashDscC@sx|dkr|tfS|dkr>tjtd�|��n|t@rjtjtd�|t@��nt}t}|dkr�t|�}nx�|D]�}||@r�t}||jkr�td�|}	tj|	��n|j|}
|
dk	r[|
\}}}
|r|
||�}q[|dkrC|||�\}}q[|||�\}}n|od|}q�q�W||fS(	sInspect revision data flags and applies transforms defined by
        registered flag processors.

        ``text`` - the revision data to process
        ``flags`` - the revision flags
        ``operation`` - the operation being performed (read or write)
        ``raw`` - an optional argument describing if the raw transform should be
        applied.

        This method processes the flags in the order (or reverse order if
        ``operation`` is 'write') defined by REVIDX_FLAGS_ORDER, applying the
        flag processors registered for present flags. The order of flags defined
        in REVIDX_FLAGS_ORDER needs to be stable to allow non-commutativity.

        Returns a 2-tuple of ``(text, validatehash)`` where ``text`` is the
        processed text and ``validatehash`` is a bool indicating whether the
        returned text should be checked for hash integrity.

        Note: If the ``raw`` argument is set, it has precedence over the
        operation and will only update the value of ``validatehash``.
        iR�twritesinvalid '%s' operations incompatible revision flag '%#x's missing processor for flag '%#x'(R�R�N(
R�R R7RRRvRtreversedR3RY(R`R.RPt	operationR�R�torderedflagsR4tvhashtmessageR5t
readtransformtwritetransformtrawtransform((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�Ls8




cC@s y�|dkr3|dkr3|j|�\}}n||j|||�kr�|jrv|jd|krvd|_n|}|dkr�tjt|��}ntjt	d�|j
tj|�f��nWnJtjk
r|j
rtj|�rtj|j
||��n�nXdS(s�Check node hash integrity.

        Available as a function so that subclasses can extend hash mismatch
        behaviors as needed.
        isintegrity check failed on %s:%sN(RYR�R�R�R%RRR RvRR�R#tbytestrR�R)tiscensoredtexttCensoredNodeError(R`R.RJRKRLRzt	revornode((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s#cC@s�t|�d}|js<|j|�|j|�tkr@dS|j|j�}|dkr}tj	t
d�|j��n|d}|dk	r�|j|�}nt|�d}|j|�}|j|j
|�|r�|j�|j�n|jd��5}x+|D]#}|j|j||�d�q
WWdQX|jd��l}|jtM_t|_|j}	x@|D]8}
|	j|j|
|j|j|
�}|j|�quWWdQX|j|j||jj�|j�dS(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 transactioniR�(RfR�R�R�t
_maxinlinetfindR�RYR RvRR�RR�tflushtcloseR�R�RyR�RyR
R,R�R{RmRJtreplaceRdR�(R`ttrR�ttiprevttrinfottrindextdataoffRnR�tioRaRs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_enforceinlinesize�s:
"



'		
%cC@sdS(s9called when trying to add a node already stored.
        N((R`ttransactionRJ((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_nodeduplicatecallback�R�c
C@s:|tkr+tjtd�|j��n|rO|pI|j|||�}n|j||d�\}
}|
|krd}nt|
�t	kr�tjtd�|jt|
�f��n|p�|j|
||�}||j
kr�|S|r|j|
|d|d|�n|j|
||||||d|d|	�S(	s�add 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)
        flags - the known flags to set on the revision
        deltacomputer - an optional deltacomputer instance shared between
            multiple calls
        s!attempted to add linkrev -1 to %sR�s;%s: size of %d bytes exceeds maximum revlog storage of 2GiBRKRLROt
deltacomputerN(
RR RvRR�R�R�RYRft
_maxentrysizeRnR�taddrawrevision(R`R.R�tlinkRKRLRORJRPR�R�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytaddrevision�s(		c

C@s�d}
|js!|jd�}
n|jd�}z2|j||||||||||
d|	�
SWd|
rx|
j�n|j�XdS(s�add a raw revision with known flags, node and parents
        useful when reusing a revision not stored in this revlog (ex: received
        over wire, or read from an external bundle).
        sa+R�N(RYR�R�R�t_addrevisionR�(R`R�R�R�RKRLRJRPROR�tdfhtifh((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�s	
cC@sY|sd|fS|jj|�}|r2d|fS|dd!dkrOd|fSd|fS(s6Generate a possibly-compressed representation of data.R�iistu(R�tcompress(R`Rjt
compressed((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�s


cC@s)|s
|S|dd!}|dkroyt|�SWq�tjk
rk}tjtd�tj|���q�Xn,|dkr|S|dkr�tj|d�Sy|j	|}Wnmt
k
ry/tjj|�}|j
�}||j	|<Wqt
k
rtjtd�|��qXnX|j|�S(s�Decompress a revlog chunk.

        The chunk is expected to begin with a header identifying the
        format type so it can be routed to an appropriate decompressor.
        iitxsrevlog decompress error: %ssR�sunknown compression type %r(t_zlibdecompressR�R RvRR*tforcebytestrR&R�R�R�R�tforrevlogheaderR�Rz(R`RjR�Rst
compressortengine((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRz-s.


!c
C@sj|tkr+tjtd�|j��n|tksC|tkrbtjtd�|j��n|jrt|	}
n|
}
|g}t|�}|d}|j	|�}|j
|�|j
|�}}|dkr�tj
tj||d�|d�}nt|�}|dkr&tj|�}nt|||||||�}|j||
�}t||�|j||j||||f}|jj|�||j|<|jdk	r�||_n|jj||j|j|�}|j||	|
||j ||�|d}|r/|dkr/|j!||
�}nt"|�t#krV|||f|_$n|j%|j&|<|S(s�internal function to add revisions to the log

        see addrevision for argument descriptions.

        note: "addrevision" takes non-raw text, "_addrevision" takes raw text.

        if "deltacomputer" is not provided or None, a defaultdeltacomputer will
        be used.

        invariants:
        - rawtext is optional (can be None); if not set, cachedelta must be set.
          if both are set, they must correspond to each other.
        s %s: attempt to add null revisions %s: attempt to add wdir revisioniiN('RR RvRR�R	RR�RfR�RzRYR!tpatchedsizeR�RdR}R�REt
finddeltainfoRBtdeltalenR�RmRiRnR�R�R{RJRyt_writeentryRjt	buildtextRAR�R�R�R�(R`RJR�R�R�RKRLRPROR�R�talwayscacheR�tfhRMtcurrtprevR@tp1rtp2rRNtrevinfot	deltainfoRsRx((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�esL			

!

c	C@s$|jdtj�|r/|jdtj�nt|�d}|js�|j|j|�|j|j|t|��|dr�|j|d�n|j|d�|j|�ni|||j	j
7}|j|j||�|j|�|j|d�|j|d�|j||�dS(Nii(RmtostSEEK_ENDRfR�RR�R�R�R�RdR�(	R`R�R�R�RxRjR�R@R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s"	

c@sAg}t|�}d}|r4|j|d�}n|jd��||jj}|jr|j|j|||�d
�n8|j|j||�|j|j	|�|j
d����fd�}	zStj|�}
x=|D]5}|\}}
}}}}}||�}|pt
}|j|�||jkrM|j||�q�nxD|
|fD]6}||jkrZtj||jtd���qZqZW||jkr�tj||jtd���n|j|�}|tkr\|j|�r\tjd�}|j|�}t|�|}|| tj||�kr\tj|j|j|���q\n|r�|j|||	�r�|tO}n|j |d
|||
||||f��dt!|�d	|
�
|r�|||�n�r�|jr��j"�|j
d��|jd��q�q�WWd
�r2�j"�n�j"�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+c@s!�r�j�n�j�dS(N(R�((R�R�(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s
sunknown parentsunknown delta bases>lllR�R�N(#RfR�R�R�RdR�RR�RYR�R�R}R�RRiRnR�R R�RRzRt
iscensoredtstructtcalcsizeR�R!treplacediffheadertCensoredBaseErrorRJt_peek_iscensoredRR�R�R�(R`R't
linkmapperR�t
addrevisioncbtnodesR�R�tisizeR�R�RjRJRKRLRZt	deltabaseRXRPR�R�R�thlentoldlentnewlen((R�R�s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytaddgroup�sp		


		

cC@s|js
tS|j|�t@S(s%Check if a file revision is censored.(R�R,RPR(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�4s	cC@s#|js
tStj|||j�S(s6Quickly check if a delta produces a censored revision.(R�R,R)tdeltaiscensoredR�(R`R�RXR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�;s	cC@s/tj|t|�d|j�|j|j�S(s�find 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(R)tresolvestripinfoRfR&R�R�(R`tminlink((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt
getstrippointBs	cC@st|�dkrdS|j|�\}}|t|�krAdS|j|�}|js|j|j|�||jj}n|||jj7}|j|j|�d|_
i|_|j�x3t
j|t|��D]}|j|j|�=q�W|j|d5d|_dS(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����(RfR�R�R�RR�R�RdR�RYR�R�R�R#R�RnRJRmR�(R`R�R�RzRR�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytstripLs$			

cC@s�d}t|�r7td|jt|�d��}ny?|j��#}|jdd�|j�}WdQX||}Wn1tk
r�}|jtjkr��nd}nXy�|j	|j
�}|jdd�|j�}|j�|jj
}td||�}|||}|jrod}	x*|D]"}
|	td|j|
��7}	q(Wd}|t|�||	}nWn1tk
r�}|jtjkr��nd}nX||fS(Niii(RfR-R�R�RmttellR�R�R�R�R�R�R�RdR�R�(R`texpectedR�tactualtddR�RlRatdit	databytesR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt	checksizeus>%

	
 
cC@s,|jg}|js(|j|j�n|S(N(R�R�RiR�(R`tres((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytfiles�s	cC@s�|dkr"tjd|��n|dkrA|jrAd}ntj|||td|jd|jd|j	d|j
d	|jd
|jd|d|d
|�	S(NR�tstoragetlinears"unhandled value for nodesorder: %st
deltaparentfnt
candeltafnt	rawsizefnt	revdifffntflagsfntsendfulltexttrevisiondatatassumehaveparentrevisionst
deltaprevious(R�R�R�N(
RYR R7R�R)t
emitrevisionsRQR�R�R�R�RPR�(R`R�t
nodesorderR�R�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR��s 	
						
talwaystsamerevstnevertfulladdcC@s�||jkr(ttd�|��nt|�rIttd���nt|dd�rpttd���nt|dd�r�ttd���n|j}|j}z7||jkr�t	|_n||j
kr�t|_n|p�||_||j|j
fk}tj
|�}	|j}
x�|D]�}|
|}|dd@}
|d}|
|d	d
}|
|dd
}|d
}d}d}|r�|j|�}|tkr�|t|j|��f}q�n|s�|j|dt	�}n||jkr-|j|||||d
|d|d|
d|	�n�|j|jddt�}d}|jso|j|jd�}nz2|j|||||||
|||d|	�
Wd|r�|j�n|j�X|r(||||�q(q(WWd||_||_XdS(s
Copy this revlog to another, possibly with format changes.

        The destination revlog will contain the same revisions and nodes.
        However, it may not be bit-for-bit identical due to e.g. delta encoding
        differences.

        The ``deltareuse`` argument control how deltas from the existing revlog
        are preserved in the destination revlog. The argument can have the
        following values:

        DELTAREUSEALWAYS
           Deltas will always be reused (if possible), even if the destination
           revlog would not select the same revisions for the delta. This is the
           fastest mode of operation.
        DELTAREUSESAMEREVS
           Deltas will be reused if the destination revlog would pick the same
           revisions for the delta. This mode strikes a balance between speed
           and optimization.
        DELTAREUSENEVER
           Deltas will never be reused. This is the slowest mode of execution.
           This mode can be used to recompute deltas (e.g. if the diff/delta
           algorithm changes).

        Delta computation can be slow, so the choice of delta reuse policy can
        significantly affect run time.

        The default policy (``DELTAREUSESAMEREVS``) strikes a balance between
        two extremes. Deltas will be reused if they are appropriate. But if the
        delta could choose a better revision, it will do so. This means if you
        are converting a non-generaldelta revlog to a generaldelta revlog,
        deltas will be recomputed if the delta's parent isn't a parent of the
        revision.

        In addition to the delta policy, the ``deltabothparents`` argument
        controls whether to compute deltas against both parents for merges.
        By default, the current default is used.
        s value for deltareuse invalid: %ssdestination revlog is not emptyRWs$source revlog has filtered revisionss)destination revlog has filtered revisionsii��iiiiR�RORJRPR�sa+R�N(t
DELTAREUSEALLR?RRfRRYR�R�tDELTAREUSEALWAYSR�tDELTAREUSESAMEREVSR,R}R�RmR�RR�R{RWtDELTAREUSEFULLADDR�R�R�R�R�R�R�(R`R�t
destrevlogR�t
deltareuseR�toldlazydeltabasetoldamdtpopulatecachedeltaR�RmRzRxRPR�RKRLRJROR�tdpR�R�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytclone�sp'				



!
		
	R�c

C@s�|jd@tkr2tjtd�|j��n|j|�}tji|d6d�}t|�|j	|�kr�tj
td���n|jd}|jd}t
|j||dt�}|j|_|j|_|j|_x?|j�D]1}|j|�}	|j|	�\}
}||kr�|j|||j|�|
||t�|j|�tkr�tj
td�d	td
���q�q�n|j|�r�|j|�tkr�tj
td���n|j|�}n|j|dt�}|j|||j|�|
||	|j|��q�W|j|jd
d�|js`|j|jd
d�n|jj |j|j�|js�|jj |j|j�n|j!�|j"|jd�dS(Ni��s%cannot censor with version %d revlogstcensoredR�s5censor tombstone must be no longer than censored datas.tmpcensoredR�s0censored revision stored as delta; cannot censorthintsEcensoring of revlogs is not fully implemented; please report this bugs:cannot censor due to censored revision having delta storedR�tlocationtstore($RyRR RvRRzR)tpackmetaRfR�R8R�R�R�R�R�R�R�R�RJR�R�R�RR�RR�R{RWRPt	addbackupR�trenameR�R�RY(
R`R�t
censornodet	tombstonet	censorrevtnewindexfiletnewdatafiletnewrlRzRJRKRLR�((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytcensorrevision1	sN

	!		
cc@s(|j�\}}|r3tdtd�|�Vn|rTtdtd�|�Vn|jd@}||dkr�tdtd�|j||df�Vnt�|d<xx|D]p}|j|�}y�|jd	d
�}|r�||j|�M}n|r|dj	|�n
|j
|�|j|�}t|j
|dt
��}	||	krztdtd�|	|fd
|�VnWq�tjk
r�|dr tdtd�d
|�V|dj	|�q q�tk
r}
tdtd�t|�tj|
�fd
|�V|dj	|�q�Xq�WdS(s�Verifies the integrity of the revlog.

        Yields ``revlogproblem`` instances describing problems that are
        found.
        R sdata length off by %d bytessindex contains %d extra bytesi��texpectedversionR\s0warning: '%s' uses revlog format %d; expected %dtskipreadt	skipflagsiR�s unpacked size is %d, %d expectedRJterroroncensoredscensored file datasunpacking %s: %sN(R�R[RRyR�RRJRhRPRRWR�RfR�R R�t	ExceptionRR*R�(R`tstateR�R�RyRzRJR tl1tl2Rs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytverifyintegrityq	sJ
	

2

c@s�i}|rQ�j�jfg|d<�jsQ|dj�j�jf�qQn|rdg|d<n|r}t��|d<n|r�tt�jt	����|d<n|r�t�fd��j
�D��|d<n|S(Ntexclusivefilestsharedfilestrevisionscountttrackedsizec3@s$|]}�jj|�jVqdS(N(R�tstatR�(Rtpath(R`(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pys	<genexpr>�	st
storedsize(R�R�R�RiR�RftsumRSR�R�R�(R`R'R(R)R*R-R�((R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytstorageinfo�	s	#
%N(gRFRGRHRYR,ReR�R&t
propertycacheR�R�R�t
contextlibtcontextmanagerR�R�R�R�R�R�RnR�R�R�RzR�RPR�R�RdR�R�R�R	RJR�R�R�R�RRR
R#R%R)R*R;R&R>R<RRIRORJRRRQRRVR_R`RgRiRlRrRuRyR{R�R�R�R�R�R�RWR�R�R�R�R�RR�R�R�RzR�R�R�R�R�R�R�R�R�R�RRtDELTAREUSENEVERRRRRR&R/(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR�.s�!Z	=									!						
				
				)	@�			
						
	"	2	0		"6		
	
		K	?1	.		9K	c			
	)	$	t@	h(fRHt
__future__RRR1R�R�R�R�RJRRRRRRRRR	R
ti18nRtrevlogutils.constantsRR
RRRRRRRRRRRRRRRt
thirdpartyRR�RRR R!R"R#R$R%R&trevlogutilsR'R}tutilsR(R)R*t	importmodR+RzR�R�RjRYR3R/R0R1R�R6R2R=R>RBRlR�RREtimplementertirevisiondeltaRQtiverifyproblemR[tStructRctpackRwtunpackRgR^R]RbR}R�t
versionformatR�R�R�R|R�(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt<module>s�Fp@	
									
		)