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/dagop.pyo
�
1�3\c@@s�ddlmZddlZddlmZddlmZddlmZm	Z	mZm
Z
mZmZej
Z
ejZdZd�Zed	�Zed
�Zd�Zedddd�Zd
�Zd�Zd�Zddd�Zd�Zd�Zed�Zd�Zed�Zd�Z ej!de"de"�de#fd��Y�Z$ej!de"de"�de#fd��Y�Z%d�Z&d�Z'd�Z(ddd �Z)d%d!�Z*d"�Z+ddd#�Z,d$�Z-dS(&i(tabsolute_importNi(tnullrev(tattr(terrortmdifftnodetpatchtpycompattsmartsetI�cc@s�|dkrd}n|dkr*t}n|dkr:dS|dkrXtjd��n|rgd}nd
}|j|�t|�}g}t|d�}|dk	r�tj|||df�nd}	x�|r�tj	|�\}
}||
}
|
|kr:t|d�}|dk	r:tj|||df�q:n|
|	k}|rf||krf|
}	|
Vn|d}
|r�|
|kr�xC||
�D]2}|t
jkr�tj||||
f�q�q�Wq�q�WdS(s(Walk DAG using 'pfunc' from the given 'revs' nodes

    'pfunc(rev)' should return the parent/child revisions of the given 'rev'
    if 'reverse' is True/False respectively.

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.
    iNsnegative stopdepthi����i(tNonet_maxlogdepthRtProgrammingErrortsorttitertnexttheapqtheappushtheappopRR(tpfunctrevst
startdeptht	stopdepthtreversetheapsigntirevstpendingheaptinputrevtlastrevtcurrevtcurdepthtfoundnewtpdepthtprev((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_walkrevtree!sD				
	
 
c#@s�i�g���fd�}|r-d}nd}x|D]}||�q:Wxj�r�tj��}�j|�}||fVx3|D]+}x"|j�| D]}||�q�Wq�WqQWdS(s�Like filectx.ancestors(), but can walk from multiple files/revisions,
    and includes the given fctxs themselves

    Yields (rev, {fctx, ...}) pairs in descending order.
    c@sN|j�}|�kr9t��|<tj�|�n�|j|�dS(N(trevtsetRRtadd(tfctxR"(tvisitt	visitheap(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytaddvisit]s

iN(R	RRtpoptparents(tfctxstfollowfirstR(tcuttcRtcurfctxstparent((R&R's5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytfilectxancestorsUs 	
	
cC@s)d�t||�D�}t|dt�S(s�Like filectx.ancestors(), but can walk from multiple files/revisions,
    and includes the given fctxs themselves

    Returns a smartset.
    cs@s|]\}}|VqdS(N((t.0R"t_cs((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pys	<genexpr>zstiterasc(R1tgeneratorsettFalse(R+R,tgen((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytfilerevancestorstsc@s�|rd�nd��j����fd���dkrH�}n*��fd�}|j�fd��}t||||dt�S(Nic@sIy�j|�� SWn-tjk
rDd��|j�� D�SXdS(Ncs@s|]}|j�VqdS(N(R"(R2tpctx((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pys	<genexpr>�s(t
parentrevsRtWdirUnsupportedR*(R"(tclR-trepo(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt
plainpfunc�sc@s)g�|�D]}�|�s
|^q
S(N((R"tr(tcutfuncR>(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt<lambda>�tc@s�|�S(N((R"(R@(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyRA�RBR(R	t	changelogtfilterR!tTrue(R=RR,RRR@R((R<R-R@R>R=s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevancestors}s			cC@s+t||||||�}t|dt�S(s�Like revlog.ancestors(), but supports additional options, includes
    the given revs themselves, and returns a smartset

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.

    If cutfunc is provided, it will be used to cut the traversal of the DAG.
    When cutfunc(X) returns True, the DAG traversal stops - revision X and
    X's ancestors in the traversal path will be skipped. This could be an
    optimization sometimes.

    Note: if Y is an ancestor of X, cutfunc(X) returning True does not
    necessarily mean Y will also be cut. Usually cutfunc(Y) also wants to
    return True in this case. For example,

        D     # revancestors(repo, D, cutfunc=lambda rev: rev == B)
        |\    # will include "A", because the path D -> C -> A was not cut.
        B C   # If "B" gets cut, "A" might want to be cut too.
        |/
        A
    R4(RFR5R6(R=RR,RRR@R7((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytrevancestors�s	c
c@s�|rd}nd}|j}|j�}tj}||kr]|Vx�|D]}|VqKWn�t|�}xz|j|�D]i}||kr�|VqynxI|j|�| D]4}	|	|kr�|	|kr�|j|�|VPq�q�WqyWdS(Ni(	R	RCtminRRR#RR:R$(
R=RR,R-R<tfirstRtitseentx((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevdescendants�s(			

c
C@s�|j}tj}gtj|t|��D]}g^q+}x�|j|d�D]v}|j|�\}}	||kr�|||j|�n|rQ|	|krQ|	|krQ||	|j|�qQqQW|S(s6Build map of 'rev -> child revs', offset from startrevi(	RCRRRtxrangetlenRR:tappend(
R=tstartrevR,R<Rt_revtdescmapRtp1revtp2rev((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_builddescendantsmap�s		+c@sI|j��t|�|����fd�}t||||dt�S(Nc@s�|�S(N((R"(RSRQ(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyR�sR(RHRVR!R6(R=RR,RRR((RSRQs5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevdescendantsofdepth�scC@sU|dkr-|dkr-t|||�}nt|||||�}t|dt�S(s�Like revlog.descendants() but supports additional options, includes
    the given revs themselves, and returns a smartset

    Scan ends at the stopdepth (exlusive) if specified. Revisions found
    earlier than the startdepth are omitted.
    R4N(R	RMRWR5RE(R=RR,RRR7((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytrevdescendants�s
cc@s�t|�}|tkr5x|�D]}|Vq"WdSt|�}x`|d|d�D]K}xB||�D]4}|tkrh||krh|j|�|VPqhqhWqUWdS(skGenerate revision number descendants in revision order.

    Yields revision numbers starting with a child of some rev in
    ``revs``. Results are ordered by revision number and are
    therefore topological. Each revision is not considered a descendant
    of itself.

    ``revsfn`` is a callable that with no argument iterates over all
    revision numbers and with a ``start`` argument iterates over revision
    numbers beginning with that value.

    ``parentrevsfn`` is a callable that receives a revision number and
    returns an iterable of parent revision numbers, whose values may include
    nullrev.
    Ntstarti(RHRR#R$(RtrevsfntparentrevsfnRIR"RKR ((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytdescendantrevs�s	
cC@s?|s
gS|jj}t|�}t|�}t�}i}|j}	|j}
|j}x�|r�|�}||kr�|	|�|s�q[q�n||�}
|
||<x3|
D]+}||kr�||kr�|
|�q�q�Wq[W|s�t�S|s�|SxBt|�D]4}x+||D]}||kr|	|�qqWqW|S(s_return (heads(::<roots> and ::<heads>))

    If includepath is True, return (<roots>::<heads>).(	RCR:R#tlistR$RPR)tbasesettsorted(R=tminroottrootstheadstincludepathR:R&t	reachableRKtreachedtdovisitt	nextvisitR"R*R0((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_reachablerootspures<						
	

cC@s�|s
t�S|j�}t|�}t|�}y|jj||||�}Wn)tk
r{t|||||�}nXt|�}|j�|S(s_return (heads(::<roots> and ::<heads>))

    If includepath is True, return (<roots>::<heads>).(R^RHR]RCtreachablerootstAttributeErrorRhR(R=RaRbRcR`R((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyRi,s

cC@sYtj|j�|j�|�}tj||�\}}td�|D��}||fS(s�Return `(diffinrange, linerange1)` where `diffinrange` is True
    if diff from fctx2 to fctx1 has changes in linerange2 and
    `linerange1` is the new line range for fctx1.
    cs@s!|]\}}|dkVqdS(t!N((R2t_tstype((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pys	<genexpr>Ds(Rt	allblockstdatat
blocksinrangetany(tfctx1tfctx2t
linerange2tdiffoptstblockstfilteredblockst
linerange1tdiffinrange((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt
_changesrange=s!c
c@sKtj|jj�}|j�}i|||ff|j�|j�f6}x�|rF|jt|��\}}|j	�}|r�|d }n|s�||fVqOnt
}	x�|D]x}
t|
|||�\}}|	p�|}	|d|dkr�q�n|j�|
_
|
|f||
j�|
j�f<q�W|	rO||fVqOqOWdS(sgYield ancestors of `fctx` with respect to the block of lines within
    `fromline`-`toline` range.
    iiN(RRut_repotuitintrofilectxtlinkrevtfilenodeR)tmaxR*R6RzR"t_descendantrev(
R%tfromlinettolineR,RuR&R.RttpltinrangetptinrangepRx((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytblockancestorsGs*+	

&cc@s�y"tt|||��\}}Wntk
r5nX||krP||fVntj|jj�}|j�}i|||ff|j�6}x|j	|j�g�D]}|j
|�}t}	x�|j|�D]�}
y||
\}}Wnt
k
rq�nXt||||�\}
}|	p)|
}	||kr�||d|kr�t|||d�\}}t|�t|�f}n||f||<q�W|	r�||fVq�q�WdS(siYield descendants of `fctx` with respect to the block of lines within
    `fromline`-`toline` range.
    iN(RR�t
StopIterationRRuR{R|tfilelogtfilerevtdescendantstfilectxR6R:tKeyErrorRztzipRHR�(R%R�R�R.RxRutflRKRJR�RLR�RtR�tlbstubs((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytblockdescendantshs2"

 tslotstfrozentannotatelinecB@sDeZej�Zej�Zejde�Zejdd�Z	RS(tdefaultN(
t__name__t
__module__RtibR%tlinenoR6tskipR	ttext(((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyR��st_annotatedfilecB@s8eZej�Zej�Zej�Zej�ZRS((R�R�RR�R+tlinenostskipsR�(((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyR��scC@s9|jd�r|jd�S|jd�tt|��S(Ns
(tendswithtcounttinttbool(R�((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_countlines�s
cC@sCt|�}tjd|d�}t|g||tg||�S(Ni(R�Rt	rangelistR�R6(R�R%tnR�((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_decoratelines�scC@s�g|D]*}|tj|j|jd|�f^q}|rkg|D]\}}|t|�f^qD}nx�|D]�\}}x}|D]u\\}	}
}}}
|
dkr�|j|	|
!|j||+|j|	|
!|j||+|j|	|
!|j||+q�q�WqrW|r�|j�g|D]\}}|gf^q}x�t|�D]�\}\}}x�|D]�\\}	}
}}}|
|	||krx�t	j
||�D]l}|j||kr�t|	|||
d�}|j||j|<|j||j|<t|j|<q�q�Wq]||dj
|	|
||f�q]WqDWx�|D]�\}}x�|D]�\}	}
}}x�t	j
||�D]l}|j||krwt|	|||
d�}|j||j|<|j||j|<t|j|<qwqwWqRWq?Wn|S(sp
    Given parent and child fctxes and annotate data for parents, for all lines
    in either parent that match the child, annotate the child with the parent's
    data.

    Additionally, if `skipchild` is True, replace all other lines with parent
    annotate data as well such that child is never blamed for any lines.

    See test-annotate.py for unit tests.
    toptst=i(RRnR�R]R+R�R�Rt	enumerateRRNRHRERP(R*t	childfctxtchildt	skipchildRuR0tpblocksR�Rvta1ta2tb1tb2ttt_blockst	remainingtidxt_ttbktak((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt
_annotatepair�s@4.%

%)cC@sC|g}i}id|6}x�|r�|j�}||krCqn||�}|||<xD|D]<}	|j|	d�d||	<|	|kr`|j|	�q`q`WqW|g|(i}
xA|r�|d}||
kr�|j�q�nt}||}x0|D](}	|	|
kr�t}|j|	�q�q�W|r�|j�t|j�|�}t}
|dk	ro|j|k}
nt	g|D]}	|
|	^qy|||
|�}x?|D]7}	||	dkr�|
|	=||	=q�||	cd8<q�W||
|<||=q�q�W|
|}gt
|j|j|j
tj|j��D]}t|�^q-S(srCore algorithm for filectx.annotate()

    `parents(fctx)` is a function returning a list of parent filectxs.
    iii����N(R)tgetRPRER6R�RoR	t	_changeidR�R�R+R�R�Rt
splitnewlinesR�R�(tbaseR*tskiprevsRuR&tpcachetneededtfR�R�thisttreadytcurrR�taR?((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytannotate�sX	
	


	




&	



cc@s|jdt�t|�}g|fg}g}t�}tj|�tj}tj}x�|D]�}	|	|kr�|||	�|j|	�nd}
xM|
|	kr�||�}
|j	|
�gt
|�D]"\}}|
|dkr�|^q�}
|
rt|
jd�}||\}}x7|
D]/}||}|j|d�||dO}q Wx@t
|
�D]
}||=q`Wn"t|�}|jg|
hf�||}|
|	kr�|dj|
�n|dj	|
�g||
�D]}|tjkr�|^q�}|dj|�x8|D]0}||kr|j|�|||�qqW|syt|�dkr�d}|d}q�n|d|@s�d}n|dk	r�||dO}x|dD]}|Vq�W|r�||=q�g|d(q�q�Wq`Wx(|D] }x|dD]}|VqWq�WdS(s"Yield revisions from heads to roots one (topo) branch at a time.

    This function aims to be used by a graph generator that wishes to minimize
    the number of parallel branches and their interleaving.

    Example iteration order (numbers show the "true" order in a changelog):

      o  4
      |
      o  1
      |
      | o  3
      | |
      | o  2
      |/
      o  0

    Note that the ancestors of merges are understood by the current
    algorithm to be on the same branch. This means no reordering will
    occur behind a merge.
    RiiN(RRER#RtheapifyRRR$R	tremoveR�R)textendtreversedRORPRRtupdate(Rtparentsfunctfirstbrancht	unblockedtgroupsRt
pendingsetRRt
currentrevR"RJtgtmatchingt	targetidxttrevsttparentstgrR�R*R?((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyttoposort+sl3		
		


5


.


		

cC@sUt|�}x2|D]*}x!||�D]}|j|�q&WqW|jtj�|S(s�Resolve the set of heads from a set of revisions.

    Receives an iterable of revision numbers and a callbable that receives a
    revision number and returns an iterable of parent revision numbers, possibly
    including nullrev.

    Returns a set of revision numbers that are DAG heads within the passed
    subset.

    ``nullrev`` is never included in the returned set, even if it is provided in
    the input set.
    (R#tdiscardRR(Rt	parentsfntheadrevsR"R ((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyR��s

cC@s�|dkrt}nt|p!g�}|h}|h}x�|d|d�D]}}xt||�D]f}||kr�||kr�|j|�n|j|�n||kr`||kr`|j|�q`q`WqMW|S(s�Returns the set of all revs that have no children with control.

    ``revsfn`` is a callable that with no arguments returns an iterator over
    all revision numbers in topological order. With a ``start`` argument, it
    returns revision numbers starting at that number.

    ``parentrevsfn`` is a callable receiving a revision number and returns an
    iterable of parent revision numbers, where values can include nullrev.

    ``startrev`` is a revision number at which to start the search.

    ``stoprevs`` is an iterable of revision numbers that, when encountered,
    will stop DAG traversal beyond them. Parents of revisions in this
    collection will be heads.
    RYiN(R	RR#R$R�(RZR[RQtstoprevsRdRbR"R ((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytheadrevssubsets			cC@s�ttt||�dt��}t�}g}x�|r�|j�}|dkr�|d}||kr�|j|�|j|�q�q3|j|d�xN||�D]@}|tj	ks�||ks�||kr�q�n|j|�q�Wq3W|S(s�Linearize and topologically sort a list of revisions.

    The linearization process tries to create long runs of revs where a child
    rev comes immediately after its first parent. This is done by visiting the
    heads of the revs in inverse topological order, and for each visited rev,
    visiting its second parent, then its first parent, then adding the rev
    itself to the output list.

    Returns a list of revision numbers.
    Rii(
R]R_R�RER#R)RPR$RR(RR�R&tfinishedtresultR"R ((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt	linearize,s !		
'((.t
__future__RRRRt
thirdpartyRRBRRRRRR^R5R
R!R6R1R8RFR	RGRMRVRWRXR\RhRiRzR�R�tsREtobjectR�R�R�R�R�R�R�R�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt<module>sF.				4				
			&	
!	'			C>�	$