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/ancestor.pyo
�
1�3\c@@s�ddlmZddlZddlmZddlmZmZejd�Z	d�Z
d�Zd	efd
��YZ
d�Zdefd
��YZdefd��YZdS(i(tabsolute_importNi(tnullrev(tpolicytpycompattparserscG@sIt|t�st|�}nt|kr1t�St|�dkrG|Sdt|�>d}dgt|�d}x(t|�D]\}}d|>||<qWd|d>}t�}t|�}t|�d}	xr|	dkrD|rD|	}
|	d8}	||
sq�n||
}||kra|d8}||kra|j|
�||O}|
|kr^|
hSqan||kr�x�||
�D]d}||}
|tkr�qzn|
dkr�|||<|d7}qz|
|krz||c|O<qzqzWq�xY||
�D]K}|tkr
q�n||}
|
r3|
|kr3|d8}n|||<q�Wq�W|S(s�Returns a set with the heads of all common ancestors of all nodes,
    heads(::nodes[0] and ::nodes[1] and ...) .

    pfunc must return a list of parent vertices for a given vertex.
    ii(t
isinstancetsetRtlentmaxt	enumeratetadd(tpfunctnodestallseentseentitntpoisontgcatinterestingtnvtvtsvtptsp((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pytcommonancestorsheadssZ	











c@s>�fd�}t�|�}t|�dkr4|S||�S(s�
    Returns the common ancestors of a and b that are furthest from a
    root (as measured by longest path).

    pfunc must return a list of parent vertices for a given vertex.
    c@s�i}t|�d}dg|}dg|}g}x[tt|��D]G\}}d||<d|>}|||<d||<|j||f�qIW|d}	x�|	dkrct|�dkrc|	}
|	d8}	||
}|dkr�q�n||
}x>�|
�D]0}
|
tkrqn||
}||
}}||kr�|d||
<||kr2||cd7<|}||
<|r�||cd8<||dkr�||=q�q�q2q||dkr||B}||kr�qn|||
<|j|d�||cd7<||cd8<||dkr2||=q2qqW||cd8<||dkr�||=q�q�Wt|�dkrzgSd�x|D]}�|O�q�Wt�fd�|D��S(Niic3@s%|]\}}�|@r|VqdS(N((t.0RR(tk(s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pys	<genexpr>�s(RR	tsortedtappendRRt
setdefaultR(RRtcounttdepthRtmappingRRtbRRtdvRRtdptnspR(R(Rs8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pytdeepestSsh






!






i(RR(Rt	orignodesR&R((Rs8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt	ancestorsLs
8tincrementalmissingancestorscB@s;eZdZd�Zd�Zd�Zd�Zd�ZRS(spersistent state used to calculate missing ancestors incrementally

    Although similar in spirit to lazyancestors below, this is a separate class
    because trying to support contains and missingancestors operations with the
    same internal data structures adds needless complexity.cC@s8t|�|_|js+|jjt�n||_dS(N(RtbasesR
RR(tselfRR*((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt__init__�s	cC@s|jo|jthkS(s0whether the common set has any non-trivial bases(R*R(R+((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pythasbases�scC@s|jj|�dS(s)grow the ancestor set by adding new basesN(R*tupdate(R+tnewbases((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pytaddbases�sc@s�|j}|j}|j|�|jt�|s6dSt|��t�fd�|D��}t|�|krtdSxotj	�t
|�dd�D]N}||kr�q�n|j|�|j||��t|�|kr�Pq�q�WdS(s:remove all ancestors of bases from the set revs (in place)Nc3@s!|]}|�krdVqdS(iN((Rtr(tstart(s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pys	<genexpr>�sii����(R*Rtdifference_updatetdiscardRRtsumRRtxrangetminR.(R+trevsR*Rt	keepcounttcurr((R2s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pytremoveancestorsfrom�s"		

&
cC@s�t|�}|j}|j}|j|�}|j|�|sDgStt|�t|��}g}xLtj|td�D]5}|s�Pn||kr�|j	|�x;||�D]-}	|j
|	�|j|	�|j|	�q�Wq{n||kr|j|�|j	|�|}
|}n||kr{|}
|}nq{xr||�D]d}	|	tkr]qH|	|ksu|	|kr�|j
|	�|j|	�|j|	�qH|
j|	�qHWq{W|j
�|S(sreturn all the ancestors of revs that are not ancestors of self.bases

        This may include elements from revs.

        Equivalent to the revset (::revs - ::self.bases). Revs are returned in
        revision number order, which is a topological order.i����(RR*RtintersectionR3RRR6RtremoveR4R
Rtreverse(R+R8t	revsvisitt
basesvisitRt	bothvisitR2tmissingR:Rt	thisvisitt
othervisit((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pytmissingancestors�sL		





		


(t__name__t
__module__t__doc__R,R-R0R;RE(((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyR)�s				cc@s�th}tj}tj}tj}|j}|rjg|D]
}	|	^q:}
|j|�tj|
�n�g}
tj|
�xn|D]f}	||	�\}}||kr�||
|�||�n||kr�||
|�||�q�q�Wx�|
r�|
d}
|
|krPn|
V||
�\}}||krn|
|dkrS||
d<n||
|�||�n
||
�||kr�||
|�||�q�q�WdS(Nii(RtheapqtheappushtheappoptheapreplaceR
R.theapify(t
parentrevstinitrevststoprevt	inclusiveRRJRKRLtseeR1tvisittp1tp2tcurrent((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt_lazyancestorsiter
sD					



	

t
lazyancestorscB@s8eZded�Zd�ZeZd�Zd�ZRS(icC@s{||_g|D]}||kr|^q|_}||_||_t�|_t|j|j|j|j�|_dS(s�Create a new object generating ancestors for the given revs. Does
        not generate revs lower than stoprev.

        This is computed lazily starting from revs. The object supports
        iteration and membership.

        cl should be a changelog and revs should be an iterable. inclusive is
        a boolean that indicates whether revs should be included. Revs lower
        than stoprev will not be generated.

        Result does not include the null revision.N(t_parentrevst	_initrevst_stoprevt
_inclusiveRt
_containsseenRWt
_containsiter(R+RR8RPRQR1((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyR,6s	,			cC@s1ytt|��tSWntk
r,tSXdS(s*False if the set is empty, True otherwise.N(tnexttitertTruet
StopIterationtFalse(R+((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt__nonzero__Ms

cC@st|j|j|j|j�S(sGenerate the ancestors of _initrevs in reverse topological order.

        If inclusive is False, yield a sequence of revision numbers starting
        with the parents of each revision in revs, i.e., each revision is
        *not* considered an ancestor of itself. Results are emitted in reverse
        revision number order. That order is also topological: a child is
        always emitted before its parent.

        If inclusive is True, the source revisions are also yielded. The
        reverse revision number order is still enforced.(RWRYRZR[R\(R+((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt__iter__WscC@s�|j}||krtS|j}|dkr2tS|dkrBtS|j}yGx@tr�t|�}||�||kr}tS||krQtSqQWWntk
r�d|_tSXdS(s5Test whether target is an ancestor of self._initrevs.N(R]RaR^tNoneRcR
R_Rb(R+ttargetRR`RRtrev((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt__contains__es(				

	(RFRGRcR,Rdt__bool__ReRi(((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyRX5s
		trustlazyancestorscB@s2eZded�Zd�Zd�Zd�ZRS(icC@sM||_||_||_t|�|_}tj||||�|_dS(N(t_indexR[R\tlistRZRRkR^(R+tindexR8RPRQRO((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyR,�s			cC@s1ytt|��tSWntk
r,tSXdS(s�False if the set is empty, True otherwise.

        It's better to duplicate this essentially trivial method than
        to subclass lazyancestors
        N(R_R`RaRbRc(R+((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyRd�s

cC@s"tj|j|j|j|j�S(N(RRkRlRZR[R\(R+((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyRe�scC@s
||jkS(N(R^(R+Rg((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyRi�s(RFRGRcR,RdReRi(((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyRk�s
		(t
__future__RRItnodeRtRRt	importmodRRR(tobjectR)RWRXRk(((s8/usr/lib64/python2.7/site-packages/mercurial/ancestor.pyt<module>s	8	Ey	+M