https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/graphmod.cpython-310.pyc
o

�]LbC�@s�dZddlmZddlmZddlmZddlmZm	Z	m
Z
mZdZdZ
d	Zd
Ze
deded
iZdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZejGd d!�d!e��Zd"d#�Zd$d%�Zd
S)&a>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.
�)�absolute_import�)�nullrev)�attr)�dagop�pycompat�smartset�util�C�P�G�M�|�:Nc		#s��i}�D]w}||}�fdd�|��D���fdd�|��D�}dd�t��D�}|D]F}|�|�}|durRt�tj�sBt����ttt�|�|g���}||<|sa|�	t
|f���|�q,|��fdd�|D����
|�q,|��t||fVqdS)	a�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.

    cs h|]}|���vr|���qS���rev��.0�p)�revsr�4/usr/lib/python3/dist-packages/mercurial/graphmod.py�	<setcomp>=� zdagwalker.<locals>.<setcomp>cs,g|]}|��tkr|���vr|���qSr)rrr��psetrr�
<listcomp>>s
�zdagwalker.<locals>.<listcomp>cSsg|]}t|f�qSr)�PARENTrrrrrC�Nc3s �|]}|�vrt|fVqdS�N)�GRANDPARENT)r�grrr�	<genexpr>Ss�zdagwalker.<locals>.<genexpr>)�parents�sorted�get�
isinstancer�baseset�setr�reachableroots�append�
MISSINGPARENT�add�extend�updater�	CHANGESET)	�repor�gpcacher�ctx�mparsr#�mpar�gpr)rrr�	dagwalker*s0�
�

��r6c#sL�t|��|D]}||}�fdd�|��D�}|��t|t|�fVqdS)z�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.
    cs$h|]}|���vrt|��f�qSr)�noderrr��includerrrbsznodes.<locals>.<setcomp>N)r(r#rr/r$)r0�nodesr7r2r#rr8rr:Ys�
��r:c
#s�g}i}d}i��j�d�D]3\}}d|vrB|�dd�\}}|dkr2|��r2t|���|i�|<q|dkrB|��rB|��|i�|<q�rPt���fdd��}	ndd�}	|D]�\}
}}}
|
|vrm|�	|
�|||
<|d7}|�
|
�}|�|
�}|d	d	���fd
d�|
D�}|�||d�<t|�D]\}}|s�|||<q�|||<|d7}q�g}t|�D]H\}}|�vr�|	|�}|�	|��
|�|||�
dd�|�
dd
�f�q�||
kr�|
D]\}}|	|�}|�	|��
|�||�
dd�|�
dd
�f�q�q�|
||||f|fV�}qVd	S)axannotates 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.
    rsgraph�.swidthscolorcs���|��i�Sr)r%�branchr)�configr0rr�<lambda>�rzcolored.<locals>.<lambda>cSsiSrrrrrrr>�sNcsg|]
\}}|�vr|�qSrr)r�ptr)�nextrrr��zcolored.<locals>.<listcomp>����)�ui�configitems�rsplit�isdigit�int�
setdefault�isalnumr	�lrucachefuncr*�index�pop�	enumerater%)�dagr0�seen�colors�newcolor�key�valr<�setting�getconf�cur�type�datar#�col�color�
addparents�ir�edges�ecol�eid�bconf�ptyper)r=r@r0r�coloredhsx�
��






��	

����rcc#s��|j}||vr
|�|�|�|��g}g}|D]"\}}	|	|kr!q|	|vr+|�|	�q|�|	�|j�|d�|j|	<qt|�}
d|
d}|dd��|���d�<��fdd�|D�}�|dd�<t|�dkr�|���f�|���df�d}
|d7}|||�||
|
ffVd}�d7�|
d7}
g}|d=t|�dksit|�dkr�|���f�t|�dkr�|���df�t��|
}
|
dkr�|d7}|j�|d�|||�||
|
ffVdS)	z9adds edge info to changelog DAG walk suitable for ascii()rr�Ncsg|]	}���|�f�qSr)rLr��nextseen�nodeidxrrr�szasciiedges.<locals>.<listcomp>�\r)rPr*rL�stylesr%r^�lenrM)rX�char�staterr#rP�knownparents�
newparentsrb�parent�ncols�widthr^�	nmorecolsrrer�
asciiedges�sR�


�rscCs2t|�D]\}\}}||kr||df||<qdS)Nr)rN)r^r]�start�endrrr�_fixlongrightedges�s
��rvc
Cs�|r8||kr8|dkr8|dkr.t|d|�}||d|dd�}|�ddg||�|Sddg||dS||d}	|	dkrK||	dd�SgS)NrrBrrd�/� rh)�maxr-)
�echars�idx�pidxrp�coldiff�pdiff�fix_tailrt�tail�	remainderrrr�_getnodelineedgestail�sr�cCs�|D]a\}}||dkrd|d|d<q||dkr$d|d|d<q||kr3|d||d|<qd|t|�kr<qd|d|<||krK||}}td|dd|�D]}||dkrbd||<qVqdS)Nrrwrdrh�+�-)rj�range)rzr^�nodeline�	interlinertrur]rrr�
_drawedges
s$
���r�cCs�|d|d�}||df|vs||f|vr&|�||d|dd��n|�ddg�||d}|dkrC|�||dd��|S)Nrdrrxr)r-)rzr{rpr^�liner�rrr�_getpaddingline s r�cs$d|��vrdS|ddd�}|r#|ddur#|��|r#|ddust|�d�ddd�}|js4dnd}t|�||krO|�|dd��t|�||ks>|r�g}g}	|�d�}
t||
dd�|
d�D]\�}|durv|��d�qf|	��d�qft	t
|
|
t|	�dd��}|	dd�}
||d�D]7}dgt|�|
||
d�<t
t|
��D]!�|
�d}t||��|
�<||�kr�dn||	�||<q�q�|js�d	d
d�ndd
i�t|�D]\�}d|vr�q��fdd
�|D�|dd�<q�dd
�|��D�}|D]}||=|�|��qdS)z�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.

    NrdrBrr�rxrwr�~)rrdcsg|]
}|p���d��qS)rx�r%�r�c�r]�maprrr`rAz$_drawendinglines.<locals>.<listcomp>cSsg|]
\}}|dur|�qSrr�rrr�rrrrcrA)
�valuesrMry�count�graphshortenrjr*rLrN�listr��items�remove)�lines�extra�edgemaprPrl�	edgechars�
shift_size�minlines�empties�toshift�first_emptyr��targets�	positionsr��posr�rorr�r�_drawendinglines5sL��
 "��r�c@sxeZdZdZejde�e�d�Zejde�e	�d�Z
ejddd�Zejddd�Zejde�e
j�d�Zejddd�ZdS)�
asciistatez State of ascii() graph renderingF)�init�defaultrN)�__name__�
__module__�__qualname__�__doc__r�ib�Factoryr�rP�dictr^�lastcoldiff�	lastindex�EDGES�copyrir�rrrrr�isr�cCs(|D]\}}|�||��d�qdS)aXoutputs 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()
    �
N)�write�rstrip)rD�graph�ln�logstrrrr�outputgraphus
�r�c
s�|\}}}}	d|	krdksJ�J�|j|j�}
�fdd�|
D�}|�dt||	t|
�d��|	dkr<t|�t|�dkoL|	dkoLdd�|D�}t|�dkoU|}
|d	|d�}|�|d
g�|�t|||j||	|j|
��|d	|d�}t	�
d|	�D]}|�d
�q�||d}|	dkr�t	�
|�D]	}|�dd
g�q�n#|	dkr�|�||dd|d��nt	�
|�D]	}|�d
d
g�q�t||||�|g}|r�|�t
||||��|jr�tdd�|D��r�|�|�n|�|�|d	||	d�}t|�t|�k�r#t|�t|�k�r#|�|d	d	��t|�t|�k�st||�|
|�t|�t|�k�rB|�d�t|�t|�k�s4t|||	���fdd�|D�}t|t||��|	|_||_d	S)a�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.
    ���rdcs&g|]}��|d�dfD]}|�qqS�rrxr�r�)r�rrr�s&zascii.<locals>.<listcomp>r�rrBcSs g|]\}}|d|kr|�qS)rr)r�x�yrrrr�rNrxrrwrhcss�|]	}|r|dvVqdS)s\/Nrr�rrrr"�s�zascii.<locals>.<genexpr>rCcs"g|]
}dd�d�|�f�qS)s%-*s rdrC)�join)rr�)�indentation_levelrrr�s�)r^rPr-ryrjrvr�r�r�r�xranger*r�r�r��anyr�r��zip)rDrlrXrk�text�coldatar{r^rpr}rPrz�add_padding_line�fix_nodeline_tailr��shift_interliner]r�r��extra_interliner)r�r�r�ascii�sx  
���� 
�
�
�
�
r�)r��
__future__rr7r�
thirdpartyr�rrrr	r/rr r+r�r6r:rcrsrvr�r�r�r��s�objectr�r�r�rrrr�<module>s./Z64

https://t.me/RX1948 - 2025