\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sdZddlmZddlZddlZddlZddlZddlZddlZddl m Z m Z m 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 l4m5Z6dd l7m8Z8m9Z9m:Z:e e!e#eee%e&e'e"e$eeeeeeee/j;d Z<ej=Z>d Z?dZ@ide6ZBdZCdZDdZEeCeDeEfZFdZGdZHdZIdZJdZKe)jLdeMdeMdeNfdYZOe8jPe1jQe)jLdeMdeNfdYZRe8jPe1jSe)jLdeMdeNfdYZTejUdZVeVjWZXeVjYZZd e[fd!YZ\d"eNfd#YZ]ejUd$Z^e^jWZ_ejUd%Z`e`jWZae`jYZbd&Zcd'eNfd(YZdd)eNfd*YZedS(+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( 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 interfaceutilt storageutilt 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||tdS(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.pytaddflagprocessorscC@s|t@s,td|}tj|n|tkrZtd|}tj|n||krtd|}tj|n||||BS(Nisunknown revlog index flagsi(Rt ValueErrorR;(toffsetttype((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt offset_typestslotstfrozent _revisioninfocB@sbeZdZejZejZejZejZejZ ejZ ejZ RS(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.pyREs       trevlogrevisiondeltacB@szeZejZejZejZejZejZejZ ejZ ejZ ejddZ RS(tdefaultN(RFRGRRIRJtp1nodetp2nodetbasenodeRPtbaserevisionsizetrevisiontdeltatNonetlinknode(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRQs        t revlogproblemcB@s>eZejddZejddZejddZRS(RRN(RFRGRRIRYtwarningR RJ(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR[ss >4l20s20s20strevlogoldindexcB@seZdZRS(cC@s8|dkr(dddddddtfStj||S(Nii(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]st revlogoldiocB@s#eZdZdZdZRS(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( Niiiiiiii( RdRRtlentindexformatv0_unpackRBtgettappendR]RY( R`tdatatinlinetstindextnodemaptntofftltcurtete2((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt parseindexs      (3 cC@s{t|dr(tjtdnt|d|d|d|d||d||d|df}t|S( Nis'index entry flags need revlog version 1iiiiii(R>R t RevlogErrorR R=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.pyRbs  s>Qiiiiii20s12xs>IitrevlogiocB@s#eZdZdZdZRS(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`eeedZdZejdZ ddZ ddZ e j d`dZdZd Zd Zd Zd d`d ZejdZdZdZdZdZdZdZdZdZdZdZdZdZ e Z!dZ"dZ#dZ$dZ%dZ&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/Z6d0Z7d1Z8d2Z9d3Z:d4Z;d5d6Z<d7Z=d8Z>d`d9Z?d`d:Z@d`d;ZAd`d<ZBd`d`d=ZCd>ZDd?ZEd@ZFdAZGdBZHd`edCZIdDZJedEZKd`d`d`dFZLd`dGZMdHZNd`d`eOd`dIZPd`d`dJZQdKZRdLZSed`dMZTdNZUd`dOZVdPZWdQZXdRZYdSZZdTZ[dUZ\d`eeedVZ]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|d d} | 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$drt&|jt'|j}||j|}||dd||ddfS(Niii(RmRz(R`RJRaR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytparentss cC@s|j|dS(Ni(t _chaininfo(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytchainlensc C@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(RRmR( R`RztchaininfocacheRmRRRstclentcompresseddeltalenRR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs2            c C@sy|jj|||jSWntk r0nXg}|j}|j}|}||}xT||dkr||kr|j||r|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(Rmt deltachainRRRiRR,treverse( R`RztstoprevtchainRmRRRststopped((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt _deltachains*            cC@st|}|j}x|D]}||qWtjtdratj|j|d|d|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.trustlazyancestorsRt inclusive( R^RJR&t safehasattrR+RRRmt lazyancestorst_uncheckedparentrevs(R`RRRtcheckrevR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt ancestorss     cC@stj||j|jS(N(RtdescendantrevsRR(R`R((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt descendantssc @s|dkrtg}n|dkr3|j}ng|D]}|j|^q:}g|D]}|j|^q\}dtfdY}||j|jtj|t }t j fd|D}xk|rQ|j }||kr qq|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(tsett addedvaluest 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(RFRGReRRRR(((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 :sN(RYRtheadsRztobjectR RRRRt collectionstdequetpopleftRRiR^tsortRJ( R`tcommonRRoRtmissingtvisitRRtmiss((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|^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(RYRRRzR%R'RJ(R`RRRoR(R((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt findmissingns   ""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||KststartrevtstoprevsN( RYRfRR&RJRRzRRtheadrevssubsetRR(R`RRRRDRRz((R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR9s &  " 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(RzRRRRiRJ(R`RJtcRRtprtprevs((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(RmRORt OverflowErrorRR(R`RRN((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(sreturn 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.(RRR,RJ(R`RLRM((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRQus   cC@s|j||j|}}y|jj||}Wn/ttfk ritj|j||}nX|rtt|j |St S(s5calculate the "best" common ancestor of nodes a and b( RzRmR RRPRRR+tmapRJR(R`RLRMRN((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRscC@sPt|tr|j|St|dkrcy|}|j||SWqctjk r_qcXny|t|}d||krtn|dkrt||}n|dks|t|krtn|j|SWnttfk rnXt|dkrLy!t |}|j||SWqLt tjfk rHqLXndS(Nis%dii(( t isinstanceR;RJRfRzR RR?RPRR(R`tidRJRz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_matchs6        c C@s?tj|}yW|jj|}|rO|j|rO|rKtjn|S|ratjndSWn]tjk rt |ddstj ||j t dqnt tfk rnX||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|jtnt|dkr t|dkr| r|d|j|<|dStj ||j t dn|rtjndSWq;tk r7q;XndS(Nt filteredrevssambiguous identifieri(iiii(Rt startswithRmt partialmatchRR RvRRYRtAmbiguousPrefixLookupErrorRR RR?RRfRRRRiRR( R`RUt maybewdirtpartialRqtprefixRstnlRo((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt _partialmatchsL   3"  cC@sZ|j|}|dk r|S|j|}|r8|Stj||jtddS(slocate a node based on: - revision number or str(revision number) - nodeid or subset of hex nodeid sno match foundN(RVRYR_R RRR (R`RURo((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytlookups ic@sLfd}dt|}fd}tddsy,tjj||}|||SWqtjk r|tkrtj |j t dqqt k rqXn|tkr x4t |dD] }|| }||r|SqWnx:t |dD])}|| }||r|||SqWdS(s7Find the shortest unambiguous prefix that matches node.c@spyj|}Wn)tjk r*tStjk r>tSX|dkrltj|jt dntS(Nsno node( R_R RZR,RRRYRRR (R]RJ(R`(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytisvalids !cS@std|DS(Ncs@s|]}|dkVqdS(RN((RRF((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pys s(tall(R]((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR[sc@s8x1t|dD] }|| }|s|SqWdS(sDisambiguate against wdirid.i)N(trange(thexnodet minlengthRR](R[(s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt disambiguates  RWsno nodei)N(RRRYR-RmtshortestR RvR RRR RRc(R`RJReRaRdRfRR]((R[R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRgs,   $       cC@s.|j|\}}tj||||kS(spcompare text with a given file revision returns True if text is different than what is stored. (RR)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(RRft _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||krtj||||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(RRtseekRRlR&R(R`R@Rtdft 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(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. iRn(RRfR&RRr( R`R@RRnRkRRqt 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(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. iiiRn(RmR;RRRdRu( R`RCtendrevRnRmtistartRRtiendR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_getsegmentforrevsis      cC@s#|j|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. Rni(t decompressRy(R`RzRn((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_chunks cC@s|s gS|j}|j}|j}|jj}tj}g} | j} |js^|f} nt j ||d|} x| D] } | d} x1| dddD]}||dkrPqqWy"|j | |d|\}}Wn4t k rg| D]}|j |d|^qSX|j}xa| D]Y}||}|rW||d|7}n||}| ||||||q*Wq}W| 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. t targetsizeiNiRni(RRRRRdR&RRiRt deltautilt slicechunkRyRPR{Rz(R`RRnR|RRRktiosizeRRqtladdt slicedchunkst revschunktfirstrevtlastrevR@RjRztdecompt chunkstartt chunklength((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_chunkss<            " '    (cC@s d|_dS(sClear the raw chunk cache.iRN(iR(R(R`((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRscC@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.pyt deltaparents   cC@sg|tkrtS|j|}|tkr/tS|j|\}}|||fkrZtS|j|S(s(tells whether rev is a snapshot (RRRRR,t issnapshot(R`RztdeltapRKRL((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs  cC@s<|j|s!tjdnt|j|ddS(s/number of snapshot in the chain before this onesrevision %d not a snapshotii(RR R7RfR(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt snapshotdepthscC@sb|tkr4|j||kr4t|j|Stj|j|dt|j|dtS(sreturn 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(RRtbytesR{R!ttextdiffRWR(R`trev1trev2((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytrevdiffs!cC@stt|tr'|}|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| krd| } n|j | d|d| } |d krt | 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. RiiiRiRnR|RRRzN(RTR;RJRYRRRzRPRRRmRRR!tpatchest _processflagst checkhash(R`t nodeorrevt_dfRRzRJt cachedrevRPtrawtextRRR|RtbinsR.t validatehash((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRWs^                 !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}|dkrt|}nx|D]}||@rt}||jkrtd|} tj| n|j|} | dk r[| \} } } |r| ||}q[|dkrC| ||\}}q[| ||\}}n|od|}qqW||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``. iRtwritesinvalid '%s' operations incompatible revision flag '%#x's missing processor for flag '%#x'(RRN( RR R7R RRvRtreversedR3RY(R`R.RPt operationRRt orderedflagsR4tvhashtmessageR5t readtransformtwritetransformt rawtransform((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRLs8           cC@s y|dkr3|dkr3|j|\}}n||j|||kr|jrv|jd|krvd|_n|}|dkrtjt|}ntjt d|j t j |fnWnJtjk r|j rtj|rtj|j ||nnXdS(sCheck node hash integrity. Available as a function so that subclasses can extend hash mismatch behaviors as needed. isintegrity check failed on %s:%sN(RYRRRR%RRR RvR RR#tbytestrRR)tiscensoredtexttCensoredNodeError(R`R.RJRKRLRzt revornode((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs  #c C@st|d}|j s<|j||j|tkr@dS|j|j}|dkr}tj t d|jn|d}|dk r|j|}nt|d}|j |}|j |j ||r|j|jn|jd5}x+|D]#}|j|j||dq WWdQX|jdl}|jtM_t|_|j} x@|D]8} | j|j| |j|j| } |j| quWWdQX|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 transactioniR(RfRRRt _maxinlinetfindRRYR RvR RRRtflushtcloseRRRyRRyR R,RR{RmRJtreplaceRdR( R`ttrRttiprevttrinfottrindextdataoffRnRtioRaRs((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_enforceinlinesizes: "      '   %cC@sdS(s9called when trying to add a node already stored. N((R`t transactionRJ((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt_nodeduplicatecallbacksc C@s:|tkr+tjtd|jn|rO|pI|j|||}n|j||d\} } | |krd}nt| t krtjtd|jt| fn|p|j| ||}||j kr|S| r|j | |d|d|n|j | ||||||d|d| S( 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) 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 %sRs;%s: size of %d bytes exceeds maximum revlog storage of 2GiBRKRLROt deltacomputerN( RR RvR RRRRYRft _maxentrysizeRnRtaddrawrevision( R`R.RtlinkRKRLRORJRPRRR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt addrevisions(     c C@sd} |js!|jd} n|jd} z2|j||||||||| | d| SWd| rx| jn| jXdS(sadd 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+RN(RYRRRt _addrevisionR( R`RRRRKRLRJRPRORtdfhtifh((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.Riistu(Rtcompress(R`Rjt compressed((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs   cC@s)|s |S|dd!}|dkroyt|SWqtjk rk}tjtdtj|qXn,|dkr|S|dkrtj|dSy|j |}Wnmt k ry/tj j |}|j }||j |lllRRN(#RfRRRRdRRRRYRRR}RRRiRnRR RR RzRt iscensoredtstructtcalcsizeRR!treplacediffheadertCensoredBaseErrorRJt_peek_iscensoredRRRR(R`R't linkmapperRt addrevisioncbtnodesRRtisizeRRRjRJRKRLRZt deltabaseRXRPRRRthlentoldlentnewlen((RRs6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytaddgroupsp               cC@s|js tS|j|t@S(s%Check if a file revision is censored.(RR,RPR(R`Rz((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR4s cC@s#|js tStj|||jS(s6Quickly check if a delta produces a censored revision.(RR,R)tdeltaiscensoredR(R`RRXR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyR;s cC@s/tj|t|d|j|j|jS(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(R)tresolvestripinfoRfR&RR(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|=qW|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(RfRRRRRRRdRRYRRRR#RRnRJRmR(R`RRRzR RR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytstripLs$     c C@sd}t|r7td|jt|d}ny?|j#}|jdd|j}WdQX||}Wn1tk r}|jtjkrnd}nXy|j |j }|jdd|j}|j |j j }td||}|||}|jrod} x*|D]"} | td|j| 7} q(Wd}|t||| }nWn1tk r}|jtjkrnd}nX||fS(Niii(RfR-RRRmttellRRRRRRRRdRR( R`texpectedRtactualtddRRlRatdit databytesR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt checksizeus> %        cC@s,|jg}|js(|j|jn|S(N(RRRiR(R`tres((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytfiless  cC@s|dkr"tjd|n|dkrA|j rAd}ntj|||td|jd|jd|j d|j d |j d |j d |d |d | S(NRtstoragetlinears"unhandled value for nodesorder: %st deltaparentfnt candeltafnt rawsizefnt revdifffntflagsfnt sendfulltextt revisiondatatassumehaveparentrevisionst deltaprevious(RRRN( RYR R7RR)t emitrevisionsRQRRRRRPR(R`Rt nodesorderRRR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyRs           talwaystsamerevstnevertfulladdcC@s||jkr(ttd|nt|rIttdnt|ddrpttdnt|ddrttdn|j}|j}z7||jkrt |_n||j krt |_n|p||_||j|j fk}t j |} |j} x|D]} | | } | dd@} | d}| | d d }| | d d }| d }d}d}|r|j| }|tkr|t|j| f}qn|s|j| d t }n||jkr-|j|||||d |d|d| d| n|j|jddt }d}|jso|j|jd}nz2|j||||||| |||d| Wd|r|jn|jX|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 revisionsiiiiiiRRORJRPRsa+RN(t DELTAREUSEALLR?R RfRRYRRtDELTAREUSEALWAYSRtDELTAREUSESAMEREVSR,R}RRmRRRR{RWtDELTAREUSEFULLADDRRRRRRR(R`Rt destrevlogRt deltareuseRtoldlazydeltabasetoldamdtpopulatecachedeltaRRmRzRxRPRRKRLRJRORtdpRR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytclonesp'            !        Rc C@s|jd@tkr2tjtd|jn|j|}tji|d6d}t||j |krtj tdn|j d}|j d}t |j||dt}|j|_|j|_|j|_x?|jD]1}|j|} |j| \} } ||kr|j|||j|| | |t|j|tkrtj tdd td qqn|j|r|j|tkrtj td n|j|} n|j|d t} |j| ||j|| | | |j|qW|j|j d d|js`|j|j d dn|jj |j |j |js|jj |j |j n|j!|j"|jddS(Nis%cannot censor with version %d revlogstcensoredRs5censor tombstone must be no longer than censored datas .tmpcensoredRs0censored revision stored as delta; cannot censorthintsEcensoring of revlogs is not fully implemented; please report this bugs:cannot censor due to censored revision having delta storedRtlocationtstore($RyRR RvR RzR)tpackmetaRfRR8RRRRRRRRRJRRRRRRRR{RWRPt addbackupRtrenameRRRY( R`Rt censornodet tombstonet censorrevt newindexfilet newdatafiletnewrlRzRJRKRLR((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pytcensorrevision1 sN       !   c c@s(|j\}}|r3tdtd|Vn|rTtdtd|Vn|jd@}||dkrtdtd|j||dfVnt|d st storedsize( RRRRiRRftsumRSRRR(R`R'R(R)R*R-R((R`s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt storageinfo s # %N(gRFRGRHRYR,ReRR&t propertycacheRRRt contextlibtcontextmanagerRRRRRRRnRRRRzRRPRRRdRRRR RJRRRRRR R R#R%R)R*R;R&R>R<RRIRORJRRRQRRVR_R`RgRiRlRrRuRyR{RRRRRRRWRRRRRRRRRRzRRRRRRRRRRRRtDELTAREUSENEVERRRRRR&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__RRR1RRRRRJRRRRRRRRR R ti18nR trevlogutils.constantsR R RRRRRRRRRRRRRRRt thirdpartyRRRRR R!R"R#R$R%R&t revlogutilsR'R}tutilsR(R)R*t importmodR+RzRRRjRYR3R/R0R1RR6R2R=R>RBRlRRREt implementertirevisiondeltaRQtiverifyproblemR[tStructRctpackRwtunpackRgR^R]RbR}Rt versionformatRRRR|R(((s6/usr/lib64/python2.7/site-packages/mercurial/revlog.pyt s      F p@               )