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: //proc/self/root/lib64/python2.7/site-packages/mercurial/branchmap.pyc
�
1�3\c@@sLddlmZddlZddlmZmZmZmZddlm	Z	m
Z
mZmZm
Z
ddlmZejZejZejZd�Zd�Zid	d6d	d
6dd	6dd6d
d6Zd�Zd�Zdefd��YZdZdeZdeZdZee�ZdZ dZ!dZ"de#fd��YZ$dS(i(tabsolute_importNi(tbinthextnullidtnullrev(tencodingterrortpycompattscmutiltutil(t
stringutilcC@s)d}|jr%d||jf}n|S(s7name of a branchcache file for a given repo or repoviewtbranch2s%s-%s(t
filtername(trepotfilename((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyt	_filename!s	cC@sd}z^y�|jt|��}t|�}t|�jd�jdd�}|d \}}t|�t|�}}d}t	|�dkr�t|d�}nt
d|d|d|�}|j|�s�td��n|j
}x�|D]�}	|	jd�}	|	sq�n|	jdd�\}
}}|dkrBtd	��ntj|j��}t|
�}
|j|
�s�td
tjt|
����n|j|g�j|
�|dkr�|jj|
�q�q�WWn�ttfk
r�dStk
rb}
|jjrYd}|jdk	r/|d
|j7}n|d7}|jj|tj |
��nd}nXWd|rz|j!�nX|S(Ns
t ittipnodettiprevtfilteredhashstip differstocsinvalid branch statesnode %s does not existtcsinvalid branchheads caches (%s)s: %s
("tNonetcachevfsRtitertnexttrstriptsplitRtinttlentbranchcachetvalidfort
ValueErrort	changelogRttolocaltstripthasnodeRtsysstrRt
setdefaulttappendt_closednodestaddtIOErrortOSErrort	Exceptiontuit	debugflagRtdebugtbytestrtclose(R
tftlineitertcachekeytlasttlrevRtpartialtcltltnodetstatetlabeltinsttmsg((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytread(sX!		

 tvisiblesvisible-hiddentservedt	immutabletbasec@sQ|j}|j}|jj|��g}�dksF�j|�r�t|���dkr�tj|�}|dkr�t��q�|j	|�}|j
�j��|jj|j}|j
�fd�|D��q�n|j
|jd�jd��|r"�j||��j|�n�j|�s=t|���|j|j<dS(Nc3@s$|]}|�jkr|VqdS(N(R(t.0tr(R7(s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>wststarti(R!Rt
_branchcachestgetRRR?tsubsettableRtfilteredt	branchmaptcopytfilteredrevstextendtrevsRtupdatetwritetAssertionError(R
R8RROt
subsetnametsubsett	extrarevs((R7s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytupdatecachegs(		# c@s(|j}|j�|j}g}g}xf|j�D]X}|j|�xB|D]:}�|�}||�\}	}
|
rN|j|�qNqNWq4W|r$t�fd�|D��}t|||j�|d|�}xMdD]B}
|j	|
�}|j
|�r�||j|
<|j|�Pq�q�WndS(s�Replace the branchmap cache for a repo with a branch mapping.

    This is likely only called during clone with a branch map from a remote.
    c3@s!|]}t�|��VqdS(N(R(RDR:(tclrev(s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>�stclosednodesRCRBRAN(RCRBRA(
R!trevt
branchinfot
itervaluesRNR'tmaxRR:RJRRGRQ(R
tbmR8tclbranchinfotrbheadstclosedtbheadsthREtbRtrtiprevtcachet	candidatetrview((RWs9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytreplacecache�s2			



	


RcB@szeZdZdeeddd�Zd�Zd�Zd�Z	d�Z
ed�Zd�Z
d�Zd	�Zd
�ZRS(
s/A dict like object that hold branches heads cache.

    This cache is used to avoid costly computations to determine all the
    branch heads of a repo.

    The cache is serialized on disk in the following format:

    <tip hex node> <tip rev number> [optional filtered repo hex hash]
    <branch head hex node> <open/closed state> <branch name>
    <branch head hex node> <open/closed state> <branch name>
    ...

    The first line is used to check if the cache is still valid. If the
    branch cache is for a filtered repo view, an optional third hash is
    included that hashes the hashes of all filtered revisions.

    The open/closed state is represented by a single letter 'o' or 'c'.
    This field can be used to avoid changelog reads when determining if a
    branch head closes a branch or not.
    cC@sYtt|�j|�||_||_||_|dkrLt�|_n	||_dS(N(	tsuperRt__init__RRRRtsetR((tselftentriesRRRRX((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRj�s			cC@sWy>|j|jj|j�ko<|jtj||j�kSWntk
rRtSXdS(s�Is the cache content valid regarding a repo

        - False when cached tipnode is unknown or if we detect a strip.
        - True when cache is up to date or a subset of current repo.N(RR!R:RRRt
IndexErrortFalse(RlR
((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyR�s
cC@sP|d}t}x3t|�D]%}||jkr|}t}PqqW||fS(shReturn tuple with last open head in heads and false,
        otherwise return last closed head and true.i����(tTruetreversedR(Ro(RltheadsttipR`Rb((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyt
_branchtip�s
cC@s|j||�dS(s�Return the tipmost open head on branch head, otherwise return the
        tipmost closed head on branch.
        Raise KeyError for unknown branch.i(Rt(Rltbranch((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyt	branchtip�sc@s�fd�|D�S(Nc3@s$|]}|�jkr|VqdS(N(R((RDtn(Rl(s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>�s((Rltnodes((Rls9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytiteropen�scC@s,||}|s(t|j|��}n|S(N(tlistRy(RlRuR`Rr((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytbranchheads�s
cc@s9x2|j�D]$\}}||f|j|�Vq
WdS(N(t	iteritemsRt(RltbnRr((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytiterbranches�scC@s"t||j|j|j|j�S(s-return an deep copy of the branchcache object(RRRRR((Rl((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRL�sc
C@s}y:|jt|�ddt�}t|j�d|jg}|jdk	re|jt|j��n|j	dj
|�d�d}x�t|j��D]n\}}x_|D]W}|d7}||j
kr�d}nd	}|j	d
t|�|tj|�f�q�Wq�W|j�|jjdd|jt|�|�Wn<tttjfk
rx}	|jjd
tj|	��nXdS(Ntwt
atomictemps%dRs
iiRtos	%s %s %s
Rs2wrote %s branch cache with %d labels and %d nodes
s couldn't write branch cache: %s
(RRRpRRRRRR'RQtjointsortedR|R(Rt	fromlocalR1R-tlogRRR*R+RtAbortR/R
tforcebytestr(
RlR
R2R4t	nodecountR<RxR:R;R=((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRQ�s,

	
c@sntj�}|j�i}|j�j}xa|D]Y}||d��\}}|j|g�j|�|r1|jj�j	|��q1q1Wt
�j��}	x�|j�D]�\}}
|j|g�}t
�fd�|D��}|j
|
�||	}
|
r5t|
�}t
�j|
|��}||8}nt|�}g|D]}�j	|�^qH||<|d}||jkr��j	|�|_||_q�q�W|j|�s&t|_t|_x`|j�D]O}t�fd�|D��}||jkr��j	|�|_||_q�q�Wntj||j�|_tj�|}|jjdd|j|�dS(s�Given a branchhead cache, self, that may have extra nodes or be
        missing heads, and a generator of nodes that are strictly a superset of
        heads missing, this function updates self to be correct.
        R!c3@s|]}�j|�VqdS(N(RY(RDR:(R8(s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>)si����c3@s|]}�j|�VqdS(N(RY(RDR:(R8(s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>DsRs(updated %s branch cache in %.4f seconds
N(R	ttimerR!trevbranchcacheRZR&R'R(R)R:RktheadrevsR|RPtmint	ancestorsR�RRRRRtvaluesR\RRR-R�R(RlR
trevgent	starttimetnewbranchest
getbranchinfoRERutclosesbrancht	topoheadstnewheadrevsRatbheadsett	uncertaintfloorrevR�t	bheadrevsRYRRrtduration((R8s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRPsJ	
 


&
		(N(t__name__t
__module__t__doc__RRRRjRRtRvRyRoR{R~RLRQRP(((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyR�s	
							s-v1s	rbc-namessrbc-revss>4sIii���I�R�cB@s\eZdZed�Zd�Zdd�Zdd�Zd�Z	dd�Z
dd�ZRS(	s�Persistent cache, mapping from revision number to branch name and close.
    This is a low level cache, independent of filtering.

    Branch names are stored in rbc-names in internal encoding separated by 0.
    rbc-names is append-only, and each branch name is only stored once and will
    thus have a unique index.

    The branch info for each revision is stored in rbc-revs as constant size
    records. The whole file is read into memory, but it is only 'parsed' on
    demand. The file is usually append-only but will be truncated if repo
    modification is detected.
    The record for each revision contains the first 4 bytes of the
    corresponding node hash, and the record is only used if it still matches.
    Even a completely trashed rbc-revs fill thus still give the right result
    while converging towards full recovery ... assuming no incorrectly matching
    node hashes.
    The record also contains 4 bytes where 31 bits contains the index of the
    branch and the last bit indicate that it is a branch close commit.
    The usage pattern for rbc-revs is thus somewhat similar to 00changelog.i
    and will grow with it but be 1/8th of its size.
    cC@s�|jdkst�||_g|_t�|_d|_y\|jj	t
�}t|�|_|r�g|jd�D]}t
j|�^qv|_nWn,ttfk
r�|r�|j|_q�nX|jr,y |jj	t�}||j(Wq,ttfk
r(}|jjdtj|��q,Xntt|j�tt|j��|_|jdkrog|_nt|j�|_td�t|j�D��|_dS(Niss(couldn't read revision branch cache: %s
cs@s!|]\}}||fVqdS(N((RDRERc((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>�s(RRRRt_repot_namest	bytearrayt_rbcrevst
_rbcsnameslenRR?t	_rbcnamesRRRR"R*R+t_branchinfoRZR-R/R
R�R�t_rbcrecsizeR!t_rbcrevslent_rbcnamescounttdictt	enumeratet
_namesreverse(RlR
treadonlytbndataR}tdataR=((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRjqs6			2	cC@sUd|_|j2d|_|jj�t|jj�|_t	|jt
�|_dS(Ni(R�R�R�R�tclearRR�R!R�R�R�R�(Rl((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyt_clear�s		
c	C@sr|p|jj}|t}|tkr5|j|�St|j�|tkra|j|d|�S|j|�t	 }t
ttj
|j�|�\}}t|t@�}|r�|tM}n|dkr�n�||kry|j||fSWq_tk
r|jjjd�|j�q_Xn@|jjjd|�|t}|j|3t|j|�|_|j|d|�S(sWReturn branch name and close flag for rev, using and updating
        persistent cache.R!ssRreferenced branch names not found - rebuilding revision branch cache from scratch
sPhistory modification detected - truncating revision branch cache to revision %d
(R�R!R�RRZRR�R�R:t_rbcnodelentunpack_fromt
_rbcrecfmtR	tbuffertboolt
_rbccloseflagt_rbcbranchidxmaskR�RnR-R/R�R�R�(	RlRYR!t	rbcrevidxtreponodet	cachenodet	branchidxR1ttruncate((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRZ�s4

!



cC@s�|p|jj}|j|�\}}||jkrF|j|}n,t|j�}|jj|�||j|<|j|�}|r�|tO}n|j	||||�||fS(s7Retrieve branch info from changelog and update _rbcrevs(
R�R!RZR�RR�R'R:R�t
_setcachedata(RlRYR!RcR1R�R�((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyR��s

cC@s�||jkr|j|}n,t|j�}|jj|�||j|<|r^|tO}n|j|||�dt|�kr�|`ndS(s%add new data information to the cacheRZN(R�RR�R'R�R�tvarsRZ(RlRuRYR:R1R�((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pytsetdata�s

cC@s�|tkrdS|p|jj}|t}t|j�|tkrs|jjdt|�tt|j��ntt|j|||�t	|j
|�|_
|jj�}|r�|jd|j
�ndS(s:Writes the node's branch data to the in-memory cache data.Nsswrite-revbranchcache(RR�R!R�RR�RNt	pack_intoR�R�R�tcurrenttransactiontaddfinalizeRQ(RlRYR:R�R!R�ttr((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyR��s

c
C@s�|j}d
}d}z�ym|jt|j�kr\d}|jdt�}|jdkr�|jjt	d�}|j
�|jkr�|jd�q�|j
�|jjdt	�d|_d|_n|jdkr|jjtdt�|jjt	d	�}n|jdjd
�|j|jD���|j
�|_|j
�t|j�|_n|jt}|t|j�kr�d}|d
kr�|jdt�}ntt|j�t|j�t�}|jjtd�}|j
�|krM|jjdt|f�|j|�|j
�|kr@d}|j|�n|j�n|t}|j|j||!�|j
�||_nWnHtttjtjfk
r�}	|jjd|tj |	�f�nXWd
|d
k	r�|j!�nXd
S(s!Save branch cache if it is dirty.ts namestwaititabss%s changed - rewriting it
t
ignoremissingtwbcs@s|]}tj|�VqdS(N(RR�(RDRc((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pys	<genexpr>sstruncating cache/%s to %d
s+couldn't write revision branch cache%s: %s
N("R�RR�RR�twlockRoRtopenR�ttellR�RQR1R-R/R�t
unlinkpathR�RpR�R�R�R!tseekR�R*R+RR�t	LockErrorR
R�trelease(
RlR�R
R�tstepR2RFROtendR=((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyRQ�sb	
	





!N(R�R�R�RpRjR�RRZR�R�R�RQ(((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyR�Zs!	*	(%t
__future__RtstructR:RRRRR�RRRRR	tutilsR
tcalcsizeR�R�RR?RRIRVRhR�Rt_rbcversionR�R�R�R�R�R�R�tobjectR�(((s9/usr/lib64/python2.7/site-packages/mercurial/branchmap.pyt<module>s4"(					9

		#�