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/graphmod.pyc
�
1�3\c@@s�dZddlmZddlmZddlmZmZmZm	Z	dZ
dZdZd	Z
id
e6de6de
6Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(s>supports walking the history as DAGs suitable for graphical output

The most basic format we use is that of::

  (id, type, data, [parentids])

The node and parent ids are arbitrary integers which identify a node in the
context of the graph returned. Type is a constant specifying the node type.
Data depends on type.
i(tabsolute_importi(tnullrev(tdagoptpycompattsmartsettutiltCtPtGtMt|t:c
#@s�i}x��D]�}||}t�fd�|j�D���g|j�D]6}|j�tkrL|j��krL|j�^qL}gt��D]}t|f^q�}x�|D]�}|j|�}	|	dkr(t�t	j
�s�t	j
���ntttj|�|g���}	||<n|	sQ|j
t|f��j|�q�|j�fd�|	D���j|	�q�W|j�t||fVq
WdS(s�cset DAG generator yielding (id, CHANGESET, ctx, [parentinfo]) tuples

    This generator function walks through revisions (which should be ordered
    from bigger to lower). It returns a tuple for each node.

    Each parentinfo entry is a tuple with (edgetype, parentid), where edgetype
    is one of PARENT, GRANDPARENT or MISSINGPARENT. The node and parent ids
    are arbitrary integers which identify a node in the context of the graph
    returned.

    c3@s-|]#}|j��kr|j�VqdS(N(trev(t.0tp(trevs(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>;sc3@s'|]}|�krt|fVqdS(N(tGRANDPARENT(R
tg(tpset(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>MsN(tsettparentsRRtsortedtPARENTtgettNonet
isinstanceRtbasesetRtreachablerootstappendt
MISSINGPARENTtaddtextendtupdatet	CHANGESET(
trepoRtgpcacheRtctxRtmparsRtmpartgp((RRs8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt	dagwalker(s(

"6%
#c#@sjt|��xW|D]O}||}t�fd�|j�D��}|j�t|t|�fVqWdS(s�cset DAG generator yielding (id, CHANGESET, ctx, [parentids]) tuples

    This generator function walks the given nodes. It only returns parents
    that are in nodes, too.
    c3@s3|])}|j��krt|j�fVqdS(N(tnodeRR(R
R(tinclude(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>[sN(RRRR!R(R"tnodesR)R$R((R*s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyR+Rs


"c#@s�g}i}d}i�x��jjd�D]�\}}d|kr+|jdd�\}}|dkr�|j�r�t|��j|i�|<q�|dkr�|j�r�|�j|i�|<q�q+q+W�r�tj��fd��}	n	d�}	x�|D]�\}
}}}
|
|kr@|j	|
�|||
<|d7}n|j
|
�}|j|
�}|}g|
D]\}}||krl|^ql}||||d+xAt|�D]3\}}|s�|||<q�|||<|d7}q�Wg}x�t|�D]�\}}||kr`|	|�}|j	||j
|�|||j
dd�|j
dd	�f�q�||
kr�x`|
D]U\}}|	|�}|j	||j
|�||j
dd�|j
dd	�f�qsWq�q�W|
||||f|fV|}q�Wd
S(sxannotates a DAG with colored edge information

    For each DAG node this function emits tuples::

      (id, type, data, (col, color), [(col, nextcol, color)])

    with the following new elements:

      - Tuple (col, color) with column and color index for the current node
      - A list of tuples indicating the edges between the current node and its
        parents.
    itgrapht.twidthtcolorc@s�j�|j�i�S(N(Rtbranch(R(tconfigR"(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt<lambda>|tcS@siS(N((R((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyR2~R3i����R3N(tuitconfigitemstrsplittisdigittintt
setdefaulttisalnumRtlrucachefuncRtindextpopt	enumerateR(tdagR"tseentcolorstnewcolortkeytvalR0tsettingtgetconftcurttypetdataRtcolR/tnexttptRt
addparentstitedgestecolteidtbconftptype((R1R"s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pytcolored_s^
 	


+

!cc@s[|d}||kr&|j|�n|j|�}g}g}xm|D]e\}	}
|
|krfqHn|
|kr�|j|
�qH|j|
�|dj|	d�|d|
<qHWt|�}d|d}|}
||
||d+g|D]}||
j|�f^q�}|
|(x�t|�dkr�|j||f�|j||df�d}|d7}|||||||ffVd}|d7}|d7}g}|d=qWt|�dkr�|j||f�nt|�dkr�|j||df�nt|
�|}|dkr&|d7}n|dj|d	�|||||||ffVd	S(
s9adds edge info to changelog DAG walk suitable for ascii()R@tstylesR
ROiis\iN(RR<RtlenR=R(RHtchartstateRRR@tnodeidxtknownparentst
newparentsRStparenttncolsR.tnextseenRROt	nmorecols((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt
asciiedges�sN

"(



cC@sJxCt|�D]5\}\}}||kr
||df||<q
q
WdS(Ni(R>(RORNtstarttend((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt_fixlongrightedges�sc
C@s�|r�||kr�|dkr�|dkrut|d|�}||d|dd!}|jddg||�|Sddg||dSn+||d}	|	dkr�||	dSgSdS(Nii����iit/t s\(tmaxR(
techarstidxtpidxR]tcoldifftpdifftfix_tailRattailt	remainder((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt_getnodelineedgestail�scC@sx|D]\}}||dkr8d|d|d<q||dkr]d|d|d<q||kr�|d||d|<qd|t|�kr�qnd|d|<||kr�||}}nx@td|dd|�D]#}||dkr�d||<q�q�WqWdS(NiRdis\t+t-(RVtrange(RgROtnodelinet	interlineRaRbRN((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt
_drawedges�s"cC@s�||d }||df|ks6||f|krY|j||d|dd!�n|jddg�||d}|dkr�|j||d�n|S(NiiRei(R(RgRhR]ROtlineRn((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt_getpaddinglines(#cC@s�d|j�krdS|ddd�}x$|rO|ddkrO|j�q,Wt|jd�ddd�}|ds�dnd}x(t|�||kr�|j|�q�W|r�g}g}	|jd�}
x_t||
dd�|
d�D]=\}}|dkr|j|d�q�|	j|d�q�Wt	t
|
|
t|	�dd��}
|	}x�||D]�}dgt|�|
||
)xgt
t|��D]S}||d}t||
|�||<||
|kr�d	n||	|||<q�WqmWn|dsid
d6dd6n
idd6}xXt|�D]J\}}d|krUq7ng|D]}|pw|j|d�^q\|(q7Wg|j�D]\}}|dkr�|^q�}x"|D]}||=|j
|�q�WdS(s�Draw ending lines for missing parent edges

    None indicates an edge that ends at between this node and the next
    Replace with a short line ending in ~ and add / lines to any edges to
    the right.

    Nii����iitgraphshorteniReRdR
t~(RtvaluesR=RftcountRVRR<R>tlistRrRtitemstremove(tlinestextratedgemapR@RXt	edgecharst
shift_sizetminlinestemptiesttoshifttfirst_emptyRNtcttargetst	positionsRvtpostmapRR~R\((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt_drawendinglinessD -&3+01
cC@s4igd6id6dd6dd6tj�d6td6S(s=returns the initial value for the "state" argument to ascii()R@ROitlastcoldifft	lastindexRURx(tEDGEStcopytFalse(((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt
asciistateOs
cC@s6x/|D]'\}}|j||j�d�qWdS(sXoutputs an ASCII graph of a DAG

    this is a helper function for 'ascii' below.

    takes the following arguments:

    - ui to write to
    - graph data: list of { graph nodes/edges, text }

    this function can be monkey-patched by extensions to alter graph display
    without needing to mimic all of the edge-fixup logic in ascii()
    s
N(twritetrstrip(R4R,tlntlogstr((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pytoutputgraphZs
c	@s�|\}}}}	d|	ko)dkns4t�|d|d}
}g|D]+}|
j|d�dfD]}
|
^qlqP}|jdt||	t|�d��|	dkr�t|�nt|�dko|	dkog|D]"\}}|d	|kr�|^q�}t|�dko%|}||d }|j|dg�|jt|||d
||	|d|��||d }x(tjd|	�D]}|j	d�q�W||d	}|	dkr�x�tj|�D]}|jddg�q�Wn\|	dkr(|j||d	d|d!�n-x*tj|�D]}|jd
dg�q8Wt
||||�|g�|r��j	t||||��n|dr�td�|D��r��j	|�q�n
�j	|�|||	d }t��t|�kr0x-t��t|�kr,�j	|�qWnt
�||
||�x)t|�t��krq|j	d�qIWtd�|
j�D��r%|dtd��fd�}xMt��D]?\}}g|D]%}
||
|�r�|
dn�^q�|(q�W|
j�fd�|
j�D��nt|||	�}g�D]#}dd|dj|�f^q?�t|t�|��|	|d<||d
<dS(s�prints an ASCII graph of the DAG

    takes the following arguments (one call per node in the graph):

      - ui to write to
      - Somewhere to keep the needed state in (init to asciistate())
      - Column of the current node in the set of ongoing edges.
      - Type indicator of node data, usually 'C' for changesets.
      - Payload: (char, lines):
        - Character to use as node's symbol.
        - List of lines to display as the node's text.
      - Edges; a list of (col, next_col) indicating the edges between
        the current node and its parents.
      - Number of columns (ongoing edges) in the current revision.
      - The difference between the number of columns (ongoing edges)
        in the next revision and the number of columns (ongoing edges)
        in the current revision. That is: -1 means one column removed;
        0 means no columns added or removed; 1 means one column added.
    i����iROR@R
Reii����iR�R�Rds\Rxcs@s!|]}|r|dkVqdS(s\/N((R
R�((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>�sR3cs@s!|]}t|�dkVqdS(iN(RV(R
RW((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>�sRUc@sQt|�dkrtSt|d �}|dkr=||kSt��||kS(Nii����i(RVtTrueR8(RWRNtnum(R(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt_drawgp�sc3@s9|]/\}}|t|�dkr*|n�fVqdS(iN(RV(R
teR�(R\(s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pys	<genexpr>�ss%-*s N(R
Re(tAssertionErrorRRRfRVRcRoRtxrangeRRuRwtanyR�RzRR>R R}tjoinR�tzip(R4RXRHRWttexttcoldataRhROR]RjR�R@RR�Rgtxtytadd_padding_linetfix_nodeline_tailRstshift_interlineRNR{textra_interlineR�Rvtindentation_level((RR\s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pytasciijsl"8(
	/	#	

7 0
N(t__doc__t
__future__RR)RR3RRRRR!RRRRR�R(R+RTR`RcRoRuRwR�R�R�R�(((s8/usr/lib64/python2.7/site-packages/mercurial/graphmod.pyt<module>s("	*	
	N	5					3