403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/graphmod.cpython-39.opt-1.pyc
a

�+�bC�@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]�}||}�fdd�|��D���fdd�|��D�}dd�t��D�}|D]�}|�|�}|dur�t�tj�s�t����ttt�|�|g���}||<|s�|�	t
|f���|�qV|��fdd�|D����
|�qV|��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�8/usr/lib64/python3.9/site-packages/mercurial/graphmod.py�	<setcomp>=�zdagwalker.<locals>.<setcomp>cs,g|]$}|��tkr|���vr|���qSr)rrr��psetrr�
<listcomp>>s�zdagwalker.<locals>.<listcomp>cSsg|]}t|f�qSr)�PARENTrrrrrCrNc3s|]}|�vrt|fVqdS�N)�GRANDPARENT)r�grrr�	<genexpr>Srzdagwalker.<locals>.<genexpr>)�parents�sorted�get�
isinstancerZbaseset�setrZreachableroots�append�
MISSINGPARENT�add�extend�updater�	CHANGESET)	�reporZgpcacher�ctxZmparsr"ZmparZgpr)rrr�	dagwalker*s,
�

�r/c#sJt|��|D]8}||}�fdd�|��D�}|��t|t|�fVqdS)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�Zincluderrrbsznodes.<locals>.<setcomp>N)r&r"rr,r#)r-�nodesr0r.r"rr1rr2Ys
�r2c
#sg}i}d}i��j�d�D]f\}}d|vr|�dd�\}}|dkrb|��rbt|���|i�|<q|dkr|��r|��|i�|<q�r�t���fdd��}	ndd�}	|D�]b\}
}}}
|
|vr�|�	|
�|||
<|d7}|�
|
�}|�|
�}|d	d	���fd
d�|
D�}|�||d�<t|�D]*\}}|�s<|||<n|||<|d7}�q$g}t|�D]�\}}|�v�r�|	|�}|�	|��
|�|||�
dd�|�
dd
�f�nL||
k�r\|
D]<\}}|	|�}|�	|��
|�||�
dd�|�
dd
�f��q��q\|
||||f|fV�}q�d	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)�configr-rr�<lambda>�rzcolored.<locals>.<lambda>cSsiSrrrrrrr6�rNcsg|]\}}|�vr|�qSrr)r�ptr)�nextrrr�rzcolored.<locals>.<listcomp>���r)�uiZconfigitems�rsplit�isdigit�int�
setdefault�isalnumr	Zlrucachefuncr'�index�pop�	enumerater$)Zdagr-�seenZcolorsZnewcolor�key�valr4ZsettingZgetconfZcur�type�datar"�colZcolorZ
addparents�ir�edgesZecolZeidZbconf�ptyper)r5r8r-r�coloredhsp
�






��	


��rLc#s�|j}||vr|�|�|�|��g}g}|D]D\}}	|	|kr@q.|	|vrT|�|	�q.|�|	�|j�|d�|j|	<q.t|�}
d|
d}|dd��|���d�<��fdd�|D�}�|dd�<t|�dk�r4|���f�|���df�d}
|d7}|||�||
|
ffVd}�d7�|
d7}
g}|d=q�t|�dk�rP|���f�t|�dk�rp|���df�t��|
}
|
dk�r�|d7}|j�|d�|||�||
|
ffVdS)	z9adds edge info to changelog DAG walk suitable for ascii()rr�Ncsg|]}���|�f�qSr)r@r�ZnextseenZnodeidxrrr�rzasciiedges.<locals>.<listcomp>�\r)rCr'r@�stylesr$rJ�lenrA)rF�char�staterr"rCZknownparentsZ
newparentsrK�parent�ncols�widthrJZ	nmorecolsrrNr�
asciiedges�sN



rWcCs2t|�D]$\}\}}||kr||df||<qdS)Nr)rB)rJrI�start�endrrr�_fixlongrightedges�srZc
Cs�|rr||krr|dkrr|dkr\t|d|�}||d|dd�}|�ddg||�|Sddg||dSn*||d}	|	dkr�||	dd�SgSdS)Nrr9rrM�/� rO)�maxr*)
�echars�idxZpidxrU�coldiffZpdiffZfix_tailrX�tail�	remainderrrr�_getnodelineedgestail�srccCs�|D]�\}}||dkr*d|d|d<q||dkrHd|d|d<q||krf|d||d|<qd|t|�krxqd|d|<||kr�||}}td|dd|�D]}||dkr�d||<q�qdS)Nrr[rMrO�+�-)rQ�range)r^rJ�nodelineZ	interlinerXrYrIrrr�
_drawedges
s
rhcCs�|d|d�}||df|vs,||f|vrL|�||d|dd��n|�ddg�||d}|dkr�|�||dd��|S)NrMrr\r)r*)r^r_rUrJ�linerbrrr�_getpaddingline s rjcsd|��vrdS|ddd�}|r8|ddur8|��qt|�d�ddd�}|jsZdnd}t|�||kr�|�|dd��q^|�r�g}g}	|�d�}
t||
dd�|
d�D].\�}|dur�|��d�q�|	��d�q�t	t
|
|
t|	�dd��}|	dd�}
||d�D]t}dgt|�|
||
d�<t
t|
��D]F�|
�d}t||��|
�<||�k�rvdn
||	�||<�qB�q|j�s�d	d
d�ndd
i�t|�D]4\�}d|v�rƐq���fdd
�|D�|dd�<�q�dd
�|��D�}|D]}||=|�|��q�dS)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.

    NrMr9rr�r\r[r�~)rrMcsg|]}|p���d��qS)r\�r$�r�c�rI�maprrr`rz$_drawendinglines.<locals>.<listcomp>cSsg|]\}}|dur|�qSrr�rrrorrrrcr)
�valuesrAr]�count�graphshortenrQr'r@rB�listrf�items�remove)�linesZextra�edgemaprCrSZ	edgecharsZ
shift_sizeZminlinesZemptiesZtoshiftZfirst_emptyro�targetsZ	positionsri�posrxrTrrpr�_drawendinglines5sD

 *
 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__rZibZFactoryrvrC�dictrJ�lastcoldiff�	lastindex�EDGES�copyrPrurrrrr~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)r:ZgraphZlnZlogstrrrr�outputgraphus
r�c
s�|\}}}}	|j|j�}
�fdd�|
D�}|�dt||	t|
�d��|	dkr\t|�t|�dko||	dko|dd�|D�}t|�dko�|}
|d|d�}|�|d	g�|�t|||j||	|j|
��|d|d�}t	�
d|	�D]}|�d	�q�||d
}|	dk�r2t	�
|�D]}|�dd	g��qnJ|	dk�r\|�||d
d|d��n t	�
|�D]}|�dd	g��qft||||�|g}|�r�|�t
||||��|j�r�td
d�|D���r�|�|�n
|�|�|d||	d�}t|�t|�k�r*t|�t|�k�r*|�|dd���qt||�|
|�t|�t|�k�rZ|�d��q:t|||	���fdd�|D�}t|t||��|	|_||_dS)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.
    cs&g|]}��|d�dfD]}|�qqS�rr\rmrr)rzrrr�rzascii.<locals>.<listcomp>r�rr9rMcSs g|]\}}|d|kr|�qS)rr)r�x�yrrrr�rNr\rr[rOcss|]}|r|dvVqdS)s\/Nrrnrrrr!�rzascii.<locals>.<genexpr>rcs"g|]}dd�d�|�f�qS)s%-*s rMr)�join)rri)�indentation_levelrrr�s)rJrCr*r]rQrZrcr�r�rZxranger'rhrjru�anyr}r��zip)r:rSrFrR�textZcoldatar_rJrUr`rCr^Zadd_padding_lineZfix_nodeline_tailrgZshift_interlinerIrtryZextra_interliner)rzr�r�ascii�sn 
 ���

 

�r�)r�Z
__future__rr0rZ
thirdpartyr�rrrr	r,rrr(r�r/r2rLrWrZrcrhrjr}�s�objectr~r�r�rrrr�<module>	s,/Z64

Youez - 2016 - github.com/yon3zu
LinuXploit