ROOTPLOIT
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: ws67150586 (67150586)
PHP: 8.3.36
Disabled: NONE
Upload Files
File: //kunden/kunden/kunden/lib/python3/dist-packages/mercurial/__pycache__/dagparser.cpython-313.pyc
�

6�hx<��~�SSKJr SSKrSSKrSSKJr SSKJrJr SSK	J
r
 SrS
SjrS
S	jr
g)�)�annotationsN�)�_)�error�pycompat)�
stringutilc#�V^^^^^^^^# �U(dg[R"[R[R-5m0mSmSmUUU4Sjn[R
"U5mU4SjmU4SjmU4SjmUUUU4SjnT"5nUS	:wGa�U[R"[R5;a1T"5nU[R"[R5;aM1US
:XaSTT/44v� TmTS-
mT"5nGOUS
:XabT"T"5[R"[R55up4[U5n[SU5HnSTT/44v� TmTS-
mM GO�US;apUS:XaT"5nU"U5up7U/nUS:Xa(U"T"55up7URU5 US:XaM(UV	s/sH
o�"U	5PM n
n	STU
44v� TmTS-
mGO.US:XaU"T"55up9U"U	5mGOUS:XaU"T"55up;TTU'STU44v� O�US:XaU"T"55up<SU4v� O�US:XaGT"5nUS:Xa)Sn
T"5nUS;aX�-
n
T"5nUS;aMSU
4v� O�U"U5up=SU
4v� O�US:XaUS;aT"5nUS;aMOgUS:Xa
SmT"5nOWUS	:XagSnSnUS	:wa$US:aX�-
nUS-
nT"5nUS	:waUS:aM[R"[S5U-5eUS	:waGM�ggs sn	f7f)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���rc�>�U(dT$US[R"[R5;aT[	U5-
$TU$)Nr)r�bytestr�string�digits�int)�ref�labels�p1�rs ����5/usr/lib/python3/dist-packages/mercurial/dagparser.py�resolve�parsedag.<locals>.resolve�s>�����I�
��V�x�'�'��
�
�6�
6��s�3�x�<���#�;��c�>�[TS5$)N�)�next)�chiters�r�nextch�parsedag.<locals>.nextch�s����F�E�"�"rc�<>�SnX;aX -
nT"5nX;aMX4$�Nr�)�c�allow�srs   �r�nextrun�parsedag.<locals>.nextrun�s+������j�
�F�A���A��j��t�rc�`>�SnX:waX:XaT"5nX0-
nT"5nX:waMT"5U4$rr )r!�limit�escaper#rs    �r�
nextdelimited�parsedag.<locals>.nextdelimited�s<������j��{��H��
�F�A���A�	�j�
�x��{�rc�@>�US:XaT"T"5SS5$T"UT5$)N�"�\r )r!rr)r$�	wordcharss ����r�
nextstring�parsedag.<locals>.nextstring�s(�����9� ���4��7�7��1�i�(�(rr�.�nr�+s*/�*�/�<�:�l�@�a�!rs

�C�c�#�$�
s+invalid character in dag description: %s...)
rrr
�
ascii_lettersr�iterbytestr�
whitespacer�range�appendr�Abortr)�descrr/r!�digs�n�i�pref�prefsr�ps�name�text�cmdr#rrrr)r$rrr.s               @@@@@@@@r�parsedagrQsG����f��� � ��!5�!5��
�
�!E�F�I��F�	�B�	�A���
!�
!�$�
'�F�#���)�)�	��A�
�u�*��8�#�#�F�$5�$5�6�6���A��8�#�#�F�$5�$5�6�6�
��9���R�D�	�/�!��B�
��F�A���A�
�$�Y��f�h��(8�(8����(G�H�G�A��D�	�A��1�a�[���Q���I�o�%����Q���!��%�Z��D�y��H�� ��m�G�A��F�E��t�)�$�V�X�.������T�"��t�)�+0�0�%�3�'�#�,�%�B�0���B��-���B�
��F�A�
�$�Y����)�F�A����B�
�$�Y� ���*�G�A��F�4�L���T�
�"�"�
�$�Y� ���*�G�A���*��
�$�Y���A��D�y����H���y�(��H�C���A��y�(��C�i��#�A�����C�i��
�$�Y��9�$��H���9�$��
�$�Y��B���A�
�%�Z���A��A��u�*��R������Q����H���u�*��R���+�+��@�A�A�E��
�I�u�*�*��61�s9�C"L)�.CL)�L)�L$�B$L)�>1L)�1AL)�7(L)�"L)c#�^^^^^^^# �SmUUUUUUU4SjnSn	U"5HYn
U
S:XaU	(aU	v� Sn	MM[U	5[U
5-U:�aU	v� Sn	OU(aU	(aU
S:waU	S-
n	X�-
n	M[ U	(aU	v� gg7f)z$generates single lines for dagtext()c��[R"SU5(aU$SURSS5RSS5-S-$)Ns^[0-9a-z]*$r,r-s\\)�re�match�replace)rOs r�
wrapstring� dagtextlines.<locals>.wrapstring.s@��
�8�8�N�D�)�)��K��d�l�l�5�'�2�:�:�4��G�G�$�N�Nrc3�># �0nSnSnSnT
GHaupEUS:XGahUupgXb:wa#[R"[S5X&4-5eU(dS/nO1UH+nX�:�dM
[R"[S5X�4-5e US-
nUS-
n	[U5S:Xa4USS:Xa+U(a"U(a	SU-v� SnT(aS	v� S
v� Sn	OSn[U5S:XaUSU	:XaT(aSv� M�US-
nM�U(a	SU-v� SnT(aS	v� /n
UHKnX�:XaU
R	S
5 MX�;aU
R	X5 M5U
R	SXh-
-5 MM SSRU
5-v� GMuU(a	SU-v� SnUS:Xa Uup�X�U'SU-v� T(aS	v� GM�GM�US:XaST"U5-v� T(aS	v� GM�GM�US:XaSU-v� S	v� GM�US:XaT(aS	v� ST"U5-v� GMUS:XaSU-v� S	v� GM[R"[S5[R"U5[R"U54-5e U(aSU-v� gg7f)NrFr2sexpected id %i, got %ir
s)parent id %i is larger than current id %irs+%d�
r?Tr1rs%dr4r5r8r7r=r;r<s!!r:r9r>s'invalid event type in dag: ('%s', '%s'))rrFr�lenrE�joinr�	escapestr)r�run�wantr�needroot�kind�datarrM�prrL�ridrN�events�usedots�wrapannotations�wrapcommands�
wraplabels�
wrapnonlinearrWs             �������r�gen�dagtextlines.<locals>.gen3s������������� �J�D��t�|�����:��+�+�a�(A�&B�e�Z�&O�P�P����B����6�"'�+�+� !�%5�!"�$%�&�	!)�#�� ���
����U���r�7�a�<�B�q�E�R�K���"(�3�,�.�"#�C�(�"'�K�"�
���#'���r�7�a�<�B�q�E�R�K��"�
��q����$�s�l�*���$�#���E����7�!�L�L��-��[�!�L�L���3�!�L�L��!�%��9�
 �����5�!1�1�1�� �3�,�&��C��4�<� $�I�C�"&�3�K���+�%�!�#��"��T�\���D�!1�1�1�#�#��$��T�\��$�,�&��K��T�\�&�#����D�!1�1�1��T�\���+�%��K��+�+��D�E�&�0�0��6�&�0�0��6�����_!�l��3�,���s
�AJ�H&JrrZr1� N)r[)re�	addspacesrirgrhrjrf�maxlinewidthrk�line�partrWs` `````    @r�dagtextlinesrr"s�����O�
\�\�|�D�����5�=���
�����4�y�3�t�9�$��4��
����t���������L�D����
��s�BBc�D�SR[UUUUUUUU55$)agenerates 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'

rZ)r\rr)�dagrnrirgrhrjrfros        r�dagtextru�s6��n�:�:����������		
��r)TFFFFF�F)�
__future__rrTr
�i18nr�rr�utilsrrQrrrur rr�<module>r{s_��#�	�
����J�^�������}�D�������br