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__/dagparser.cpython-39.pyc
a

�+�b�<�@sdddlmZddlZddlZddlmZddlmZmZddl	m
Z
dd�Zddd
�Zddd�Z
dS)�)�absolute_importN�)�_)�error�pycompat)�
stringutilc#s|sdSt�tjtj��i�d�d����fdd��t�|���fdd���fdd	���fd
d������fdd
�}��}|dk�r|t�tj�vr���}q�|dkr�d��gffV���d7���}q||dk�r&���t�tj��\}}t|�}t�d|�D]"}d��gffV���d7��qq||dv�r�|dk�r@��}||�\}}|g}|dk�rx|���\}}|�	|��qR�fdd�|D�}d�|ffV���d7�q||dk�r�|���\}}	�|	��q||dk�r�|���\}}
��|
<d�|
ffVq||dk�r|���\}}d|fVq||dk�r���}|dk�rhd}��}|dv�r\||7}��}�q@d |fVn||�\}}d!|fVq||d"k�r�|dv�r��}�q�q||d#k�r�d���}q||dk�r�dSd}
d}|dk�r�|d$k�r�|
|7}
|d7}��}�q�t
�td%�|
��q|dS)&a#parses a DAG from a concise textual description; generates events

    "+n" is a linear run of n nodes based on the current default parent
    "." is a single node based on the current default parent
    "$" resets the default parent to -1 (implied at the start);
        otherwise the default parent is always the last node created
    "<p" sets the default parent to the backref p
    "*p" is a fork at parent p, where p is a backref
    "*p1/p2/.../pn" is a merge of parents p1..pn, where the pi are backrefs
    "/p2/.../pn" is a merge of the preceding node and p2..pn
    ":name" defines a label for the preceding node; labels can be redefined
    "@text" emits an annotation event for text
    "!command" emits an action event for the current node
    "!!my command
" is like "!", but to the end of the line
    "#...
" is a comment up to the end of the line

    Whitespace between the above elements is ignored.

    A backref is either
     * a number n, which references the node curr-n, where curr is the current
       node, or
     * the name of a label you placed earlier using ":name", or
     * empty to denote the default parent.

    All string valued-elements are either strictly alphanumeric, or must
    be enclosed in double quotes ("..."), with "" as escape character.

    Generates sequence of

      ('n', (id, [parentids])) for node creation
      ('l', (id, labelname)) for labels on nodes
      ('a', text) for annotations
      ('c', command) for actions (!)
      ('C', command) for line actions (!!)

    Examples
    --------

    Example of a complex graph (output not shown for brevity):

        >>> len(list(parsedag(b"""
        ...
        ... +3         # 3 nodes in linear run
        ... :forkhere  # a label for the last of the 3 nodes from above
        ... +5         # 5 more nodes on one branch
        ... :mergethis # label again
        ... <forkhere  # set default parent to labeled fork node
        ... +10        # 10 more nodes on a parallel branch
        ... @stable    # following nodes will be annotated as "stable"
        ... +5         # 5 nodes in stable
        ... !addfile   # custom command; could trigger new file in next node
        ... +2         # two more nodes
        ... /mergethis # merge last node with labeled node
        ... +4         # 4 more nodes descending from merge node
        ...
        ... """)))
        34

    Empty list:

        >>> list(parsedag(b""))
        []

    A simple linear run:

        >>> list(parsedag(b"+3"))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))]

    Some non-standard ways to define such runs:

        >>> list(parsedag(b"+1+2"))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))]

        >>> list(parsedag(b"+1*1*"))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))]

        >>> list(parsedag(b"*"))
        [('n', (0, [-1]))]

        >>> list(parsedag(b"..."))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [1]))]

    A fork and a join, using numeric back references:

        >>> list(parsedag(b"+2*2*/2"))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [0])), ('n', (3, [2, 1]))]

        >>> list(parsedag(b"+2<2+1/2"))
        [('n', (0, [-1])), ('n', (1, [0])), ('n', (2, [0])), ('n', (3, [2, 1]))]

    Placing a label:

        >>> list(parsedag(b"+1 :mylabel +1"))
        [('n', (0, [-1])), ('l', (0, 'mylabel')), ('n', (1, [0]))]

    An empty label (silly, really):

        >>> list(parsedag(b"+1:+1"))
        [('n', (0, [-1])), ('l', (0, '')), ('n', (1, [0]))]

    Fork and join, but with labels instead of numeric back references:

        >>> list(parsedag(b"+1:f +1:p2 *f */p2"))
        [('n', (0, [-1])), ('l', (0, 'f')), ('n', (1, [0])), ('l', (1, 'p2')),
         ('n', (2, [0])), ('n', (3, [2, 1]))]

        >>> list(parsedag(b"+1:f +1:p2 <f +1 /p2"))
        [('n', (0, [-1])), ('l', (0, 'f')), ('n', (1, [0])), ('l', (1, 'p2')),
         ('n', (2, [0])), ('n', (3, [2, 1]))]

    Restarting from the root:

        >>> list(parsedag(b"+1 $ +1"))
        [('n', (0, [-1])), ('n', (1, [-1]))]

    Annotations, which are meant to introduce sticky state for subsequent nodes:

        >>> list(parsedag(b"+1 @ann +1"))
        [('n', (0, [-1])), ('a', 'ann'), ('n', (1, [0]))]

        >>> list(parsedag(b'+1 @"my annotation" +1'))
        [('n', (0, [-1])), ('a', 'my annotation'), ('n', (1, [0]))]

    Commands, which are meant to operate on the most recently created node:

        >>> list(parsedag(b"+1 !cmd +1"))
        [('n', (0, [-1])), ('c', 'cmd'), ('n', (1, [0]))]

        >>> list(parsedag(b'+1 !"my command" +1'))
        [('n', (0, [-1])), ('c', 'my command'), ('n', (1, [0]))]

        >>> list(parsedag(b'+1 !!my command line\n +1'))
        [('n', (0, [-1])), ('C', 'my command line'), ('n', (1, [0]))]

    Comments, which extend to the end of the line:

        >>> list(parsedag(b'+1 # comment\n+1'))
        [('n', (0, [-1])), ('n', (1, [0]))]

    Error:

        >>> try: list(parsedag(b'+1 bad'))
        ... except Exception as e: print(pycompat.sysstr(bytes(e)))
        invalid character in dag description: bad...

    N���rcs4|s�S|dt�tj�vr(�t|�S�|SdS)Nr)r�bytestr�string�digits�int)�ref)�labels�p1�r��9/usr/lib64/python3.9/site-packages/mercurial/dagparser.py�resolve�s
zparsedag.<locals>.resolvecs
t�d�S)N�)�nextr)�chiterrr�nextch�szparsedag.<locals>.nextchcs$d}||vr||7}��}q||fS�N�r)�cZallow�s�rrr�nextrun�s
zparsedag.<locals>.nextruncs4d}||kr*||kr��}||7}��}q��|fSrr)r�limit�escaperrrr�
nextdelimited�szparsedag.<locals>.nextdelimitedcs$|dkr���dd�S�|��SdS)N�"�\r)r)rr r�	wordcharsrr�
nextstring�szparsedag.<locals>.nextstringr�.�nr�+s*/�*�/csg|]}�|��qSrr)�.0r
)rrr�
<listcomp>�rzparsedag.<locals>.<listcomp>�<�:�l�@�a�!rs

�C�c�#�$�
s+invalid character in dag description: %s...)
rr	r
�
ascii_lettersrZiterbytestrZ
whitespacerZxrange�appendr�Abortr)Zdescr$rZdigs�n�iZpref�prefs�psr
�name�text�cmdrr)	rrrr rrrrr#r�parsedags�

	



















�rATF�Fc#s�dd���������fdd�}d}	|�D]\}
|
dkrF|	r�|	Vd}	q*t|	�t|
�|krf|	Vd}	n|r~|	r~|
dkr~|	d7}	|	|
7}	q*|	r�|	Vd	S)
z$generates single lines for dagtext()cSs,t�d|�r|Sd|�dd��dd�dS)Ns^[0-9a-z]*$r!r"s\\)�re�match�replace)r?rrr�
wrapstring.sz dagtextlines.<locals>.wrapstringc
3s�i}d}d}d}�D�]h\}}|dk�r�|\}}||krNt�td�||f��|sZdg}n(|D]"}||kr^t�td�||f��q^|d7}|d}	t|�dkr�|ddkr�|r�|r�d|Vd}�r�d	Vd
Vd}	nd}t|�dk�r|d|	k�r��rdVn|d7}n�|�r"d|Vd}��r.d	Vg}
|D]H}||	k�rP|
�d
�n,||v�rj|
�||�n|
�d||��q6dd�|
�Vq|�r�d|Vd}|dk�r�|\}}|||<d|V��r~d	Vq|dk�r�d�|�V��r~d	Vq|dk�rd|Vd	Vq|dk�r@��r0d	Vd�|�Vq|dk�r\d|Vd	Vqt�td�t�|�t�|�f��q|�r�d|VdS)NrFr&sexpected id %i, got %irs)parent id %i is larger than current id %irs+%d�
r5Tr%rs%dr(r)r.r-r3r1r2s!!r0r/r4s'invalid event type in dag: ('%s', '%s'))rr9r�lenr8�joinrZ	escapestr)
r�runZwantrZneedroot�kind�datarr=�prr<Zridr>��events�usedots�wrapannotations�wrapcommands�
wraplabels�
wrapnonlinearrFrr�gen3s�
���













���zdagtextlines.<locals>.genrrGr%� N)rH)rO�	addspacesrSrQrRrTrP�maxlinewidthrU�line�partrrNr�dagtextlines"s ^

r[cCsd�t||||||||��S)a�generates lines of a textual representation for a dag event stream

    events should generate what parsedag() does, so:

      ('n', (id, [parentids])) for node creation
      ('l', (id, labelname)) for labels on nodes
      ('a', text) for annotations
      ('c', text) for commands
      ('C', text) for line commands ('!!')
      ('#', text) for comment lines

    Parent nodes must come before child nodes.

    Examples
    --------

    Linear run:

        >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [0]))])
        '+2'

    Two roots:

        >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [-1]))])
        '+1 $ +1'

    Fork and join:

        >>> dagtext([(b'n', (0, [-1])), (b'n', (1, [0])), (b'n', (2, [0])),
        ...          (b'n', (3, [2, 1]))])
        '+2 *2 */2'

    Fork and join with labels:

        >>> dagtext([(b'n', (0, [-1])), (b'l', (0, b'f')), (b'n', (1, [0])),
        ...          (b'l', (1, b'p2')), (b'n', (2, [0])), (b'n', (3, [2, 1]))])
        '+1 :f +1 :p2 *f */p2'

    Annotations:

        >>> dagtext([(b'n', (0, [-1])), (b'a', b'ann'), (b'n', (1, [0]))])
        '+1 @ann +1'

        >>> dagtext([(b'n', (0, [-1])),
        ...          (b'a', b'my annotation'),
        ...          (b'n', (1, [0]))])
        '+1 @"my annotation" +1'

    Commands:

        >>> dagtext([(b'n', (0, [-1])), (b'c', b'cmd'), (b'n', (1, [0]))])
        '+1 !cmd +1'

        >>> dagtext([(b'n', (0, [-1])),
        ...          (b'c', b'my command'),
        ...          (b'n', (1, [0]))])
        '+1 !"my command" +1'

        >>> dagtext([(b'n', (0, [-1])),
        ...          (b'C', b'my command line'),
        ...          (b'n', (1, [0]))])
        '+1 !!my command line\n+1'

    Comments:

        >>> dagtext([(b'n', (0, [-1])), (b'#', b' comment'), (b'n', (1, [0]))])
        '+1 # comment\n+1'

        >>> dagtext([])
        ''

    Combining parsedag and dagtext:

        >>> dagtext(parsedag(b'+1 :f +1 :p2 *f */p2'))
        '+1 :f +1 :p2 *f */p2'

    rG)rIr[)ZdagrWrSrQrRrTrPrXrrr�dagtext�sW��r\)TFFFFFrB)TFFFFFrB)Z
__future__rrCr
Zi18nr�rrZutilsrrAr[r\rrrr�<module>s2�
�

Youez - 2016 - github.com/yon3zu
LinuXploit