403Webshell
Server IP : 74.208.236.16  /  Your IP : 216.73.216.220
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u102440577 ( 7172810)
PHP Version : 8.4.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/mercurial/dirstateutils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/python3/dist-packages/mercurial/dirstateutils/__pycache__/v2.cpython-313.pyc
�

6�h�;���SSKJr SSKrSSKrSSKJr \R(aSSKrSSKJrJ	r	 \	R"S5rSrSr
\R"S5r\R"S	5r\\R":Xde\
\R":XdeS
rSrSrS
r\R,"SS55rSrSrSrSrSrg)�)�annotationsN�)�attr)�error�policy�parsers�,z>LLLLL4s20sz>LHHLHLLLLHllli c�X�[RU5unnnnnn	n
[XX$U5 g)a&parse a full v2-dirstate from a binary data into dictionaries:

- map: a {path: entry} mapping that will be filled
- copy_map: a {path: copy-source} mapping that will be filled
- data: a binary blob contains v2 nodes data
- tree_metadata:: a binary blob of the top level node (from the docket)
N)�
TREE_METADATA�unpack�parse_nodes)�map�copy_map�data�
tree_metadata�root_nodes_start�root_nodes_len�_nodes_with_entry_count�_nodes_with_copy_source_count�_unreachable_bytes�_unused�_ignore_patterns_hashs           �</usr/lib/python3/dist-packages/mercurial/dirstateutils/v2.py�parse_dirstaterFs8�� 	���]�+�����%������t�~�F�c�|�[U5H�nU[U--n[X&[5n[R	U5u
nn	n
nnn
nnnnnnn[XX-U5 [RRUUUU5nUR(dM�[X(U	5nUUU'U(dM�[X+U5UU'M� g)a	parse <len> nodes from <data> starting at offset <start>

This is used by parse_dirstate to recursively fill `map` and `copy_map`.

All directory specific information is ignored and do not need any
processing (DIRECTORY, ALL_UNKNOWN_RECORDED, ALL_IGNORED_RECORDED)
N)
�range�	NODE_SIZE�slice_with_len�NODErr
r�DirstateItem�from_v2_data�any_tracked)rrr�start�len�i�
node_start�
node_bytes�
path_start�path_len�_basename_start�copy_source_start�copy_source_len�children_start�children_count�_descendants_with_entry_count�_tracked_descendants_count�flags�size�mtime_s�mtime_ns�item�paths                       rr
r
Zs����3�Z���Y��]�*�
�#�D�i�@�
�
�K�K�
�#�	
��������)�&�����	�C�4��H��#�#�0�0���g�x�P�������d��9����D�	���+����H�T�N�9rc��XX-$�N�)rr$r%s   rrr�s�����$�$rc��\rSrSr\R
"5r\R
"5r\R
"SS9r\R
"SS9r	\R
"SS9r
\R
"SS9r\R
"SS9rSr
Srg)�Node�N)�defaultrc��URnURU5nURnUn[U5nUR	S5S-nUbU[U5-n	[U5n
OSn	Sn
UbUR5up�p�O[nSnSn
Sn[RUUUU	U
URURURURUUU
U5
$)N�/�r)
r7�get�entryr%�rfind�v2_data�DIRSTATE_V2_DIRECTORYr �pack�children_offsetr/�descendants_with_entry�tracked_descendants)�selfr�paths_offsetr7�copyrCr)r*�basename_startr,r-r2r3r4r5s               rrG�	Node.pack�s����y�y���|�|�D�!���
�
��!�
��t�9�����D�)�A�-���� ,�s�4�y� 8��!�$�i�O� !���O���-2�]�]�_�*�E��(�*�E��D��G��H��y�y������� � �����'�'��$�$�����
�	
rr:)�__name__�
__module__�__qualname__�__firstlineno__r�ibr7rC�parentr/rHrIrJrG�__static_attributes__r:rrr<r<�se���7�7�9�D��G�G�I�E�
�W�W�T�
"�F��W�W�Q�'�N��g�g�a�(�O�!�W�W�Q�/���'�'�!�,��$
rr<c	���[5nSnSnSnSnSnSnSn	[U5S:Xa[RUUUUUUU	5n
X*4$[	UR5SS9n/n[
SS5n
URU
5 [US5GHhununnUS-
nX�;aUS-
n[U5n[UX�5n
U
=RS-
slUR(aU
=RS-
sl
U
=RS-
slUR[
UUU
55 S	nSnU[U5:aX�Sn[UU5(+nU(dM�[!X�X,5 U(dM�U
R"S:wdM�U
R$nUSL=(a" [U[US
R"55nUbU(aGM=[!UXU5 Un
U(dGMVU
R"S:waMqGMk UR'5n
U
R"S:XdU
R"5e[U5S:Xd[U55e[RU
R(U
RUUUUU	5n
X*4$)aA
Pack `map` and `copy_map` into the dirstate v2 binary format and return
the tuple of (data, metadata) bytearrays.

The on-disk format expects a tree-like structure where the leaves are
written first (and sorted per-directory), going up levels until the root
node and writing that one to the docket. See more details on the on-disk
format in `mercurial/helptext/internals/dirstate-v2`.

Since both `map` and `copy_map` are flat dicts we need to figure out the
hierarchy. This algorithm does so without having to build the entire tree
in-memory: it only keeps the minimum number of nodes around to satisfy the
format.

# Algorithm explanation

This explanation does not talk about the different counters for tracked
descendants and storing the copies, but that work is pretty simple once this
algorithm is in place.

## Building a subtree

First, sort `map`: this makes it so the leaves of the tree are contiguous
per directory (i.e. a/b/c and a/b/d will be next to each other in the list),
and enables us to use the ordering of folders to have a "cursor" of the
current folder we're in without ever going twice in the same branch of the
tree. The cursor is a node that remembers its parent and any information
relevant to the format (see the `Node` class), building the relevant part
of the tree lazily.
Then, for each file in `map`, move the cursor into the tree to the
corresponding folder of the file: for example, if the very first file
is "a/b/c", we start from `Node[""]`, create `Node["a"]` which points to
its parent `Node[""]`, then create `Node["a/b"]`, which points to its parent
`Node["a"]`. These nodes are kept around in a stack.
If the next file in `map` is in the same subtree ("a/b/d" or "a/b/e/f"), we
add it to the stack and keep looping with the same logic of creating the
tree nodes as needed. If however the next file in `map` is *not* in the same
subtree ("a/other", if we're still in the "a/b" folder), then we know that
the subtree we're in is complete.

## Writing the subtree

We have the entire subtree in the stack, so we start writing it to disk
folder by folder. The way we write a folder is to pop the stack into a list
until the folder changes, revert this list of direct children (to satisfy
the format requirement that children be sorted). This process repeats until
we hit the "other" subtree.

An example:
    a
    dir1/b
    dir1/c
    dir2/dir3/d
    dir2/dir3/e
    dir2/f

Would have us:
    - add to the stack until "dir2/dir3/e"
    - realize that "dir2/f" is in a different subtree
    - pop "dir2/dir3/e", "dir2/dir3/d", reverse them so they're sorted and
      pack them since the next entry is "dir2/dir3"
    - go back up to "dir2"
    - add "dir2/f" to the stack
    - realize we're done with the map
    - pop "dir2/f", "dir2/dir3" from the stack, reverse and pack them
    - go up to the root node, do the same to write "a", "dir1" and "dir2" in
      that order

## Special case for the root node

The root node is not serialized in the format, but its information is
written to the docket. Again, see more details on the on-disk format in
`mercurial/helptext/internals/dirstate-v2`.
rssc�*�USRS5$)Nrr@)�split)�xs r�<lambda>�pack_dirstate.<locals>.<lambda>s��1�Q�4�:�:�d�3Cr)�keyrNrAT���)�	bytearrayr%rrG�sorted�itemsr<�append�	enumerate�
get_folder�move_to_correct_node_in_treer/�trackedrJrI�is_ancestor�pack_directory_childrenr7rU�poprH)rrrrr�nodes_with_entry_count�nodes_with_copy_source_count�unreachable_bytes�unused�ignore_patterns_hashr�
sorted_map�stack�current_node�indexr7rC�current_folder�should_pack�	next_pathrU�in_ancestor_of_next_paths                      r�
pack_dirstaterw�s���V�;�D����N���#$� ���
�F�'��
�3�x�1�}�%�*�*���"�(��� �
�
��"�"���	�	��)C�D�J�
�E���T�?�L�	�L�L��� )�*�a� 8���}��e��!�#����(�A�-�(�#�D�)��3��L�
��	�#�#�q�(�#��=�=��,�,��1�,��+�+�q�0�+�
���T�$��|�4�5����	��3�z�?�"�#�)�!�,�I�)�)�^�D�D�K��;�#�L�D�H��%�L�-�-��4�&�,�,��+4�D�+@�,��	�:�e�B�i�n�n�+E�F�)��>�%=��'����F�%���%�L�-�-��4�4�3!9�N�9�9�;�L�����#�6�\�%6�%6�6�#��u�:��?�&�C��J�&�?�!�&�&��$�$��#�#��$�����M���rc�<�SU;aURSS5S$S$)zM
Return the folder of the path that's given, an empty string for root paths.
r@rArr)�rsplit)r7s rrdrd[s%��'+�d�l�4�;�;�t�Q���"�;��;rc��US:XagX::agURS5nURS5n[S[X#555$)z�Returns whether `maybe_ancestor` is an ancestor of `path`.

>>> is_ancestor(b"a", b"")
True
>>> is_ancestor(b"a/b/c", b"a/b/c")
False
>>> is_ancestor(b"hgext3rd/__init__.py", b"hgext")
False
>>> is_ancestor(b"hgext3rd/__init__.py", b"hgext3rd")
True
rTFr@c3�.# �UHupX:Hv� M
 g7fr9r:)�.0�c�os   r�	<genexpr>�is_ancestor.<locals>.<genexpr>ts���L�"K�$�!�q�v�"K�s�)rY�all�zip)r7�maybe_ancestor�path_components�ancestor_componentss    rrgrgbsM����������j�j��&�O�(�.�.�t�4���L�#�o�"K�L�L�Lrc���XR:wa�[XR5(a�U[UR5SRS5nUR	SS5SnUR(aURS-U-nOUnUSnURU:XaUnO@U=R
S-
sl[
USU5nURU5 OURnXR:waM�U$)z�
Move inside the dirstate node tree to the node corresponding to
`target_folder`, creating the missing nodes along the way if needed.
Nr@rArr^)	r7rgr%�lstriprYr/r<rbrU)�
target_folderrqrp�prefix�subfolder_name�subfolder_path�	next_nodes       rrerews���
�,�,�
,��}�&7�&7�8�8�"�3�|�'8�'8�#9�#;�<�C�C�D�I�F�#�\�\�$��2�1�5�N�� � �!-�!2�!2�T�!9�N�!J��!/���b�	�I��~�~��.� )���+�+�q�0�+�#�N�D�,�G�����\�*�(�.�.�L�)�,�,�
,�*�rc�f�/nUSRS:wa�[USR5UR:XaZURUR55 USRS:wa([USR5UR:XaMZU(d#[R
"SUR-5eUR
5 [5nUH�nURU[U5S9nURU5 URUR5 URURURS55 U=RUR-
slU=RUR-
sl
M� [U5UlURU5 g)zS
Write the binary representation of the direct sorted children of `node` to
`data`
r^rsno direct children for %r)rrLN)r7rdrbrir�ProgrammingError�reverser_rGr%�extendrBrJrIrH)�noderrrp�direct_children�packed_children�child�packeds        rrhrh�sC��
�O�
��)�.�.�C�
�J�u�R�y�~�~�$>�$�)�)�$K����u�y�y�{�+���)�.�.�C�
�J�u�R�y�~�~�$>�$�)�)�$K���$�$�%A�D�I�I�%M�N�N������k�O� �����X�C��I��F�����v�&����E�J�J�����H�L�L����S�1�2�� � �E�$=�$=�=� ��#�#�u�'C�'C�C�#�
!��t�9�D���K�K�� r)�
__future__r�struct�typing�
thirdpartyr�
TYPE_CHECKING�rr�	importmodr�TREE_METADATA_SIZEr�Structrr r3rFrr
r�sr<rwrdrgrerhr:rr�<module>r�s���#�
�
��
�����
�
�
�9�
%��
���	��
�
�m�,�
�&�}�}�%�&���]�/�/�/�/�/��D�I�I���� ��G�(&�R%����-
�-
��-
�``�F<�M�*�:!r

Youez - 2016 - github.com/yon3zu
LinuXploit