403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.208
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/python3/dist-packages/breezy/bzr/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

p��g ����SrSSKrSSKrSSKJr SSKJr SSKJrJ	r	J
r
JrJrJ
r
Jr SSKJr SSKJr SS	KJr SS
KJr \R"\"5S5 SSKJrJrJrJrJrJr "S
S\5r"SS\5rSSjr Sr!Sr""SS\\5r#"SS5r$"SS\\5r%"SS\5r&\RN"\&5 "SS\&5r(\RN"\(5 g)z6Tree classes, representing directory at point in time.�N)�deque�)�branch)�
controldir�debug�errors�lazy_import�osutils�revision�trace)�	transport)�
ControlDir)�MutableTree)�RevisionTreeze
from breezy import (
    add,
    )
from breezy.bzr import (
    inventory as _mod_inventory,
    )
)�FileTimestampUnavailable�	InterTree�MissingNestedTree�Tree�
TreeChange�TreeFilec�^�\rSrSr\R
SS/-rSU4SjjrSrSrSr	Sr
S	rS
r\
S5rSrS
rU=r$)�InventoryTreeChange�3�file_id�	parent_idc

�D>�XlXPl[T
U]
UUUUUUU	S9 g)N)�path�changed_content�	versioned�name�kind�
executable�copied)rr�super�__init__)�selfrrrrrr r!r"r#�	__class__s          ��:/usr/lib/python3/dist-packages/breezy/bzr/inventorytree.pyr%�InventoryTreeChange.__init__6s6�����"��
����+����!��	�	
�c�j�SRURRUR55$)Nz{}{!r})�formatr'�__name__�	_as_tuple�r&s r(�__repr__�InventoryTreeChange.__repr__Ns$�����t�~�~�6�6����8H�I�Ir*c	���URURURURURUR
URURUR4	$�N)	rrrrrr r!r"r#r/s r(r.�InventoryTreeChange._as_tupleQsM���L�L��I�I�� � ��N�N��N�N��I�I��I�I��O�O��K�K�

�
	
r*c��[U[5(a!UR5UR5:H$[U[5(aUR5U:H$g�NF)�
isinstancerr.�tuple�r&�others  r(�__eq__�InventoryTreeChange.__eq__^sJ���e�Z�(�(��>�>�#�u���'8�8�8��e�U�#�#��>�>�#�u�,�,�r*c�D�UR5UR5:$r3)r.r9s  r(�__lt__�InventoryTreeChange.__lt__es���~�~��%�/�/�"3�3�3r*c�b�URS:XaURSURS:g$g)N�TTr�F)rr"r/s r(�
meta_modified�!InventoryTreeChange.meta_modifiedhs.���>�>�\�)��?�?�1�%�����);�;�;�r*c�@�URSURS:g$�NrrB)rr/s r(�
is_reparented�!InventoryTreeChange.is_reparentedms���~�~�a� �D�N�N�1�$5�5�5r*c��UR(+=(aq SUR;=(a[ SUR;=(aE URSURS:g=(d URSURS:g$rF)r#r rr/s r(�renamed�InventoryTreeChange.renamedpss�����O�
Y��D�I�I�%�
Y��D�N�N�*�
Y����1�����1��-�W�����1B�d�n�n�UV�FW�1W�		
r*c��URURURSS4URURSS4UR
SS4URSS4URSS4URSS4SS9	$)NrF)r#)	r'rrrrrr r!r"r/s r(�discard_new�InventoryTreeChange.discard_newys����~�~��L�L�
�Y�Y�q�\�4� �� � �
�^�^�A�
��%�
�^�^�A�
��%�
�Y�Y�q�\�4� �
�Y�Y�q�\�4� �
�_�_�Q�
��&���

�
	
r*)rr)F)r-�
__module__�__qualname__�__firstlineno__r�	__slots__r%r0r.r;r>rCrG�propertyrJrM�__static_attributes__�
__classcell__)r's@r(rr3s_����$�$�	�;�'?�?�I��
�0J�
��4��
6��
��
�
�
r*rc���\rSrSrSrSr\S5rSr\	"\SS9r
SrS	rSSjr
SSjrS
rSrSrSrSrSSjrSrSrS SjrSrSrS!SjrS!SjrSrSrS!SjrSrg
)"�
InventoryTree�a�A tree that relies on an inventory for its metadata.

Trees contain an `Inventory` object, and also know how to retrieve
file texts mentioned in the inventory, either from a working
directory or from a store.

It is possible for trees to contain files that are not described
in their inventory or vice versa; for this use `filenames()`.

Subclasses should set the _inventory attribute, which is considered
private to external API users.
c��g�NT�r/s r(�supports_symlinks�InventoryTree.supports_symlinks�s��r*c�$�URS5$)Nz.bzr)�
startswith)�clsrs  r(�is_special_path�InventoryTree.is_special_path�s�����v�&�&r*c��UR$r3��
_inventoryr/s r(�_get_root_inventory�!InventoryTree._get_root_inventory�s�����r*zRoot inventory of this tree)�docTc��[U[5(a.[U5S:wa[SR	U55eUSnUR
U4$)z�Find the inventory and inventory file id for a tree file id.

:param file_id: The tree file id, as bytestring or tuple
:return: Inventory and inventory file id
rBz$nested trees not yet supported: {!r}r)r7r8�len�
ValueErrorr,�root_inventory)r&rs  r(�_unpack_file_id�InventoryTree._unpack_file_id�sN���g�u�%�%��7�|�q� � �!G�!N�!N�w�!W�X�X��a�j�G��"�"�G�+�+r*Nc���Uc/nUcgURXUS9n[5nUH$nURURU55 M& U$![R
a MAf=f)a�Find related paths in tree corresponding to specified filenames in any
of `lookup_trees`.

All matches in all trees will be used, and all children of matched
directories will be used.

:param paths: The filenames to find related paths for (if None, returns
    None)
:param trees: The trees to find file_ids within
:param require_versioned: if true, all specified filenames must occur in
    at least one tree.
:return: a set of paths for the specified filenames and their children
    in `tree`
N��require_versioned)�	paths2ids�set�add�id2pathr�NoSuchId)r&�paths�treesrq�file_ids�retrs       r(�find_related_paths_across_trees�-InventoryTree.find_related_paths_across_trees�ss��"�=��E��=���>�>�%�BS�>�T���e���G�
�������W�-�.� �
�
���?�?�
��
�s� A�A(�'A(c�>�Uc/n[X/[U5-U5$)a+Return all the ids that can be reached by walking from paths.

Each path is looked up in this tree and any extras provided in
trees, and this is repeated recursively: the children in an extra tree
of a directory that has been renamed under a provided path in this tree
are all returned, even if none exist under a provided path in this
tree, and vice versa.

:param paths: An iterable of paths to start converting to ids from.
    Alternatively, if paths is None, no ids should be calculated and None
    will be returned. This is offered to make calling the api unconditional
    for code that *might* take a list of files.
:param trees: Additional trees to consider.
:param require_versioned: If False, do not raise NotVersionedError if
    an element of paths is not versioned in this tree and all of trees.
)�find_ids_across_trees�list)r&rwrxrqs    r(rr�InventoryTree.paths2ids�s'��"�=��E�$�U�F�T�%�[�,@�BS�T�Tr*c��UR5 URU5SsSSS5 $!,(df   g=f)z$Return the id for path in this tree.rBN)�	lock_read�_path2inv_file_id�r&rs  r(�path2id�InventoryTree.path2id�s+��
�^�^�
��)�)�$�/��2��
�
�s�/�
=c�(�URU5SL$r3)r�r�s  r(�is_versioned�InventoryTree.is_versioned�s���|�|�D�!��-�-r*c�^�URU5up#Uc[R"U5eU$)zYLookup an inventory entry by path.

:param path: Path to look up
:return: InventoryEntry
)�_path2inv_ie�_mod_transport�
NoSuchFile�r&r�inv�ies    r(�_path2ie�InventoryTree._path2ie�s1���#�#�D�)���
�:� �+�+�D�1�1��	r*c�r�URn[U[5(aUnO[R"U5nUR
nU(adUR
U5upEnU(a@URSRU5URUR5RnU(aMdUcgX$4$)N�/�NN)rlr7rr
�	splitpath�root�get_entry_by_path_partial�_get_nested_tree�joinr�reference_revision)r&rr��	remainingr��bases      r(r��InventoryTree._path2inv_ie�s����!�!���d�D�!�!��I��)�)�$�/�I�
�X�X���"%�"?�"?�	�"J��B�i���+�+��H�H�T�N�B�J�J��0E�0E�� �.���i��:���w�r*c�J�URU5up#UcgX#R4$)z�Lookup a inventory and inventory file id by path.

:param path: Path to look up
:return: tuple with inventory and inventory file id
r�)r�rr�s    r(r��InventoryTree._path2inv_file_ids*���#�#�D�)���
�:���J�J��r*c���URU5up1URU5$![Ra�nUS:Xa�S[R
;a[R"SS5 UR5HZnURU5n[R"XVRU55s sSnA$![Ra MXf=f [R"X5UeSnAff=f)z2Return the path for a file id.

:raises NoSuchId:
�down�evilrz0id2path with nested trees scales with tree size.N)rmrurrvr�debug_flagsr�mutter_callsite�iter_references�get_nested_treer
�pathjoin)r&r�recurse�	inventory�er�subtrees       r(ru�InventoryTree.id2paths���
"�1�1�'�:��	�	8��$�$�W�-�-�����	8��&� ��U�.�.�.��)�)��M��!�0�0�2�D�"�2�2�4�8�G��&�/�/��o�o�g�6N�O�O��!�?�?�����	3��/�/�$�0�a�7��	8�s?�&�C5�AC0�$B<�4C0�6C5�<C�C0�C�C0�0C5c�l�UR5VVs1sHupURiM snn$s snnfr3)�iter_entries_by_dirr�r&r�entrys   r(�all_file_ids�InventoryTree.all_file_ids's+��15�1I�1I�1K�L�1K�+�$��
�
�1K�L�L��Ls�0c�X�UR5VVs1sHupUiM	 snn$s snnfr3)r�r�s   r(�all_versioned_paths�!InventoryTree.all_versioned_paths*s'��(,�(@�(@�(B�C�(B����(B�C�C��Cs�&c�v^^^^�TR5 Ubk/mUHbnTRU5upEU(a4UTRLa%[SR	UTR55eTRU5 Md OSmUUUU4SjmT"TR5sSSS5 $!,(df   g=f)z�Walk the tree in 'by_dir' order.

This will yield each entry in the tree as a (path, entry) tuple.
The order that they are yielded is:

See Tree.iter_entries_by_dir for details.
Nz{!r} != {!r}c3��># �URTS9H�upURS:Xa�T(a�T	RXRUR5nUR5 URnT"U5H(upRU(a[R"X5OUU4v� M* SSS5 M�X4v� M� g!,(df   M�=f![Ra	 X4v� M�f=f7f)N)�specific_file_ids�tree-reference)r�r!r�rr�r�rlr
r�r�NotBranchError)
r��pr�r��subinv�subp�inventory_file_ids�iter_entries�recurse_nestedr&s
      ����r(r��7InventoryTree.iter_entries_by_dir.<locals>.iter_entriesBs������3�3�&8�4��D�A��v�v�!1�1�n�
X�&*�&;�&;� !�9�9�a�.B�.B�'�G�")�!2�!2�!4�)0�)?�)?��/;�F�/C�G�D�HL�7�+;�+;�A�+D�RS�VW�*W�$W�0D�"5�!4�
 �d�
�!�"5�!4�� &�4�4�'�"#�$�J�'�sA�,C-�&C
�C-�&AB;�'C-�;
C
	�C-�
C*�&C-�)C*�*C-)r�r�rl�AssertionErrorr,�append)r&�specific_filesr�rr��inv_file_idr�r�s` `   @@r(r��!InventoryTree.iter_entries_by_dir-s�����^�^�
��)�%'�"�*�D�-1�-C�-C�D�-I�*�I� �Y�d�6I�6I�%I�,�*�1�1�)�T�=P�=P�Q���'�-�-�k�:�
+�&*�"�
#�
#�& �� 3� 3�4�A�
�
�s�BB*�*
B8c��UR5 URU5nURS:wa[R"U5eUR
R
5sSSS5 $!,(df   g=f)N�	directory)r�r�r!r�
NotADirectory�children�values�r&rr�s   r(�iter_child_entries� InventoryTree.iter_child_entriesWsS��
�^�^�
����t�$�B��w�w�+�%��*�*�4�0�0��;�;�%�%�'�	�
�
�s�AA,�,
A:c��SSKJn URU5nURU5nUR	XUS5nUR	URU5XVS5nUcSn	O"UR	URU5XVS5n	XgX�4$)NrB��
versionedfilesthis:sother:sbase:)�r�r��_PlanMergeVersionedFile�_get_file_revisionru)
r&rr:r�r�r�vf�last_revision_a�last_revision_b�last_revision_bases
          r(�_get_plan_merge_data�"InventoryTree._get_plan_merge_data^s���#��,�,�t�$��
�
2�
2�7�
;���1�1�$��X�N���2�2��M�M�'�"�G��
���<�!%��!%�!8�!8����W�%�w�H�"���O�G�Gr*c�T�URXU5nUupVpxURXgU5$)aGenerate a merge plan based on annotations.

If the file contains uncommitted changes in this tree, they will be
attributed to the 'current:' pseudo-revision.  If the file contains
uncommitted changes in the other tree, they will be assigned to the
'other:' pseudo-revision.
)r��
plan_merge�	r&rr:r��datar�r�r�r�s	         r(�plan_file_merge�InventoryTree.plan_file_mergeos2���(�(��d�;��CG�@��_��}�}�_�?Q�R�Rr*c�T�URXU5nUupVpxURXgU5$)aGenerate a merge plan based lca-newness.

If the file contains uncommitted changes in this tree, they will be
attributed to the 'current:' pseudo-revision.  If the file contains
uncommitted changes in the other tree, they will be assigned to the
'other:' pseudo-revision.
)r��plan_lca_merger�s	         r(�plan_file_lca_merge�!InventoryTree.plan_file_lca_merge{s4���(�(��d�;��CG�@��_�� � ��CU�V�Vr*c#��# �UR5HnURU5v� M g![Ra+ URR
RU5v� MZf=f7f)z?Iterate through parent trees, defaulting to Tree.revision_tree.N)�get_parent_ids�
revision_treer�NoSuchRevisionInTreer�
repository)r&�revision_ids  r(�_iter_parent_trees� InventoryTree._iter_parent_trees�sb����.�.�0�K�
H��(�(��5�5�1���.�.�
H��k�k�,�,�:�:�;�G�G�
H�s%�A1�/�A1�;A.�*A1�-A.�.A1c���SSKJn UnUR5Vs/sHorURU54PM nnUR	U5n	URUR
X&4X�[R"U	5S95 SSS5 URRn
U
RnX�R;aURRU5 U$s snf!,(df   Na=f)�>Ensure that file_id, tree_revision is in vf to plan the merge.rBr�)�sizeN)r�r�r��get_file_revision�get_file�add_content�FileContentFactoryr
�filesizerr��texts�fallback_versionedfilesr�)r&rrr��
tree_revisionr��
last_revision�t�parent_keys�f�repo�base_vfs            r(r�� InventoryTree._get_file_revision�s���#�%�
�:>�:Q�:Q�:S�
�:S�Q�a�)�)�$�/�0�:S�	�
��]�]�4�
 �A��N�N��0�0��,�k�7�CS�CS�TU�CV�1��
�!��{�{�%�%���*�*���4�4�4��&�&�-�-�g�6����
�!�
 �s�C�
6C�
C)c��SSKJn U"XS9$)NrB)�TransformPreview��pb)�	transformr)r&rrs   r(�preview_transform�InventoryTree.preview_transform�s��/���,�,r*r[rZ)r�r6r3) r-rOrPrQ�__doc__r\�classmethodrarfrSrl�supports_file_idsrmr{rrr�r�r�r�r�rur�r�r�r�r�r�r�r�r�rrTr[r*r(rWrW�s������'��'���1�7T�U�N���
,�48��<U�*3�
.�	��"	�8�,M�D�(5�T(�H�"
S�
W�H��(-r*rWc�@�U(dg[XU5n[X15$)a�Find the ids corresponding to specified filenames.

All matches in all trees will be used, and all children of matched
directories will be used.

:param filenames: The filenames to find file_ids for (if None, returns
    None)
:param trees: The trees to find file_ids within
:param require_versioned: if true, all specified filenames must occur in
    at least one tree.
:return: a set of file ids for the specified filenames and their children.
N)�_find_ids_across_trees�_find_children_across_trees)�	filenamesrxrq�specified_path_idss    r(r~r~�s$����/�	�BS�T��&�'9�A�Ar*c�$�/n[5nUHQnSnUH,nURU5nUcMURU5 SnM. U(dM@URU5 MS [	U5S:�aU(a[
R"U5eU$)a|Find the ids corresponding to specified filenames.

All matches in all trees will be used, but subdirectories are not scanned.

:param filenames: The filenames to find file_ids for
:param trees: The trees to find file_ids within
:param require_versioned: if true, all specified filenames must occur in
    at least one tree.
:return: a set of file ids for the specified filenames
TFr)rsr�rtr�rjr�PathsNotVersionedError)	r
rxrq�
not_versioned�interesting_ids�	tree_path�	not_found�treers	         r(rr�s����M��e�O��	��	��D��l�l�9�-�G��"��#�#�G�,�!�	�	�
�9�� � ��+���=��A��"3��+�+�M�:�:��r*c���[U5nUn[U5S:�a�[5nUHdnUH[nURU5nURU5H0nURU;dMURUR5 M2 M] Mf URU5 Un[U5S:�aM�U$![Ra M�f=f![Ra M�f=f)z�Return a set including specified ids and their children.

All matches in all trees will be used.

:param trees: The trees to find file_ids within
:return: a set containing all specified ids and their children
r)
rsrjrurrvr�rrtr��update)	�
specified_idsrxr�pending�new_pendingrrr�childs	         r(rr�s����-�(�O��G��g�,��
��e���G�����<�<��0�D��!%�!8�!8��!>�� �=�=��?�'�O�O�E�M�M�:�"?�
��	���{�+����g�,��
� �����������+�+����s)�B7�"C�*C�7C�C�C*�)C*c�Z�\rSrSrSrS
SjrSrSSjrSrS
Sjr	SS	jr
S
rSrSr
g)�MutableInventoryTreei�c���UR5 UR5 URnURU5 UR	U5 SSS5 g!,(df   g=f)z�Apply changes to the inventory as an atomic operation.

:param changes: An inventory delta to apply to the working tree's
    inventory.
:return None:
:seealso Inventory.apply_delta: For details on the changes parameter.
N)�lock_tree_write�flushrl�apply_delta�_write_inventory)r&�changesr�s   r(�apply_inventory_delta�*MutableInventoryTree.apply_inventory_delta�sJ���
!�
!�
#��J�J�L��%�%�C��O�O�G�$��!�!�#�&�	$�
#�
#�s�?A�
A'Nc� �UR5 [UR55S:�a
SSS5 gUcUR5nUR	U5nUR5(a1[
U5nURS:Xa[
U5nSSS5 g[SU5n[
[U55 SSS5 g![a SSS5 gf=f![a SSS5 gf=f!,(df   g=f)z�Quickly check that the tree contains at least one commitable change.

:param _from_tree: tree to compare against to find changes (default to
    the basis tree and is intended to be used by tests).

:return: True if a change is found. False otherwise
rBNTr�Fc�6�USSS:g=(a USS:g$)N�r�symlink�r�r[)�cs r(�<lambda>�2MutableInventoryTree.has_changes.<locals>.<lambda>*s"��a��d�1�g��2�K�q��t�|�7K�Kr*)r�rjr��
basis_tree�iter_changesr\�nextr�
StopIteration�filter�iter)r&�
_from_treer#�changes    r(�has_changes� MutableInventoryTree.has_changess���^�^�
��4�&�&�(�)�A�-���
��!�!�_�_�.�
��'�'�
�3�G��%�%�'�'�!�!�'�]�F��'�'�<�7�!%�g�����
�8!�K�W���!���g��'��G�
��%�!� �#�
�!��$%�!� �E�
�B!��C�
�sX�C?�9C?�3&C�#
C?�1C'�C?�
C$�C?�#C$�$C?�'
C<�1C?�;C<�<C?�?
D
c�J�UR(dURU5nU$)z<If our tree isn't case sensitive, return the canonical path.)�case_sensitive�get_canonical_pathr�s  r(�_fix_case_of_inventory_path�0MutableInventoryTree._fix_case_of_inventory_path2s ���"�"��*�*�4�0�D��r*c��UR5 [USS5bA[5nUR5H"nUR	UR55 M$ OSn[
XU5nURXS9 U(a!UR5nURU5 URUR4sSSS5 $!,(df   g=f)a�Version file_list, optionally recursing into directories.

This is designed more towards DWIM for humans than API clarity.
For the specific behaviour see the help for cmd_add().

:param file_list: List of zero or more paths.  *NB: these are
    interpreted relative to the process cwd, not relative to the
    tree.*  (Add and most other tree methods use tree-relative
    paths.)
:param action: A reporter to be called with the inventory, parent_ie,
    path and kind of the path being added. It may return a file_id if
    a specific one should be used.
:param save: Save the inventory after completing the adds. If False
    this provides dry-run functionality by doing the add and not saving
    the inventory.
:return: A tuple - files_added, ignored_files. files_added is the count
    of added files, and ignored_files is a dict mapping files that were
    ignored to the rule that caused them to be ignored.
�	conflictsN�r�)r�getattrrsr>r�associated_filenames�_SmartAddHelperrt�get_inventory_deltar$�added�ignored)	r&�	file_listr��action�save�conflicts_relatedr+�adder�invdeltas	         r(�	smart_add�MutableInventoryTree.smart_add8s���(�
!�
!�
#��t�[�$�/�;�%(�E�!����)�A�%�,�,�Q�-C�-C�-E�F�*�%)�!�#�D�2C�D�E��I�I�i�I�1�� �4�4�6���*�*�8�4��;�;��
�
�-�!$�
#�
#�s�B,C�
Cc�x�UR5U:XaURU/5 gUR5nUR5 [RU5nSSS5 WR
U5 [URRXA5nURX4/5 g!,(df   NS=f)a�Update the parents of this tree after a commit.

This gives the tree one parent, with revision id new_revid. The
inventory delta is applied to the current basis tree to generate the
inventory for the parent new_revid, and all other parent trees are
discarded.

All the changes in the delta should be changes synchronising the basis
tree with some or all of the working tree, with a change to a directory
requiring that its contents have been recursively included. That is,
this is not a general purpose tree modification routine, but a helper
for commit which is not required to handle situations that do not arise
outside of commit.

See the inventory developers documentation for the theory behind
inventory deltas.

:param new_revid: The new revision id for the trees parent.
:param delta: An inventory delta (see apply_inventory_delta) describing
    the changes from the current left most parent revision to new_revid.
N)r��set_parent_idsr.r��_mod_inventory�mutable_inventory_from_treer!�InventoryRevisionTreerr��set_parent_trees)r&�	new_revid�delta�basisr��rev_trees      r(�update_basis_by_delta�*MutableInventoryTree.update_basis_by_delta^s���4����9�,������,�����!��
�_�_�
�'�B�B�5�I�I�	�
	���e�$�(����)?�)?��V�����	�4�5�6��
�s�B+�+
B9c��SSKJn U"XS9$)NrB)�InventoryTreeTransformr)rr[)r&rr[s   r(r�MutableInventoryTree.transform�s��5�%�d�2�2r*c��[U[5(aSUb[U[5(d
[5eUb[U[5(d
[5eU/nUbU/nUbU/nUVs/sHoDR	S5PM nnUcS/[U5-nO"[U5[U5:Xd
[5eUcS/[U5-nO"[U5[U5:wa
[5eUR
5 UHCnURU5(a[R"US9e[R"U5 ME URX5 URXU5 SSS5 gs snf!,(df   g=f)afAdd paths to the set of versioned paths.

Note that the command line normally calls smart_add instead,
which can automatically recurse.

This adds the files to the tree, so that they will be
recorded by the next commit.

Args:
  files: List of paths to add, relative to the base of the tree.
  kinds: Optional parameter to specify the kinds to be used for
    each file.
  ids: If set, use these instead of automatically generated ids.
    Must be the same length as the list of files, but may
    contain None for ids that are to be autogenerated.

TODO: Perhaps callback with the ids and paths as they're added.
Nr���filename)r7�str�bytesr��striprjr�is_control_filenamer�ForbiddenControlFileErrorr
r��
_gather_kinds�_add)r&�files�kinds�idsrr�s      r(rt�MutableInventoryTree.add�sW��&�e�S�!�!��K�:�c�5�#9�#9�$�&�&��M�Z��s�%;�%;�$�&�&��G�E����e��� ����-2�3�U�T���C��U��3��;��&�3�u�:�%�C���H��E�
�*�$�&�&��=��F�S��Z�'�E�
��Z�3�u�:�
%� �"�"�
�
!�
!�
#����+�+�A�.�.� �:�:�A�F�F��!�!�!�$�	�
���u�,��I�I�e�C�(�$�
#��4�$�
#�s�-E9�A-E>�>
Fc�,�[UR5e)z4Helper function for add - sets the entries of kinds.)�NotImplementedErrorre)r&rgrhs   r(re�"MutableInventoryTree._gather_kinds�s��!�$�"4�"4�5�5r*c�,�[UR5e)aHelper function for add - updates the inventory.

:param files: sequence of pathnames, relative to the tree root
:param kinds: sequence of  inventory kinds of the files (i.e. may
    contain "tree-reference")
:param ids: sequence of suggested ids for the files (may be None)
)rlrf)r&rgrhris    r(rf�MutableInventoryTree._add�s��"�$�)�)�,�,r*r[r3)TNTr�)r-rOrPrQr$r6r;rLrXrrtrerfrTr[r*r(rr�s3��'�+�Z�$.�L'7�R3�
5)�n6�-r*rc�J�\rSrSrSrSrSrSrSrSr	SS	jr
S
S
jrSrg)rBi�z!Helper for MutableTree.smart_add.c�H�[URR55$r3)r�	_invdeltar�r/s r(rC�#_SmartAddHelper.get_inventory_delta�s���D�N�N�)�)�+�,�,r*c���URRU5nUbUS$URRU5n[	URRU/S95S$![a gf=f)z�Retrieve the most up to date inventory entry for a path.

:param inv_path: Normalized inventory path
:return: Inventory entry (with possibly invalid .children for
    directories)
N��r�rB)rr�getrr;r0r�r1)r&�inv_pathr�s   r(�_get_ie�_SmartAddHelper._get_ie�sw�����"�"�8�,������8�O��9�9�8�8��B��	���	�	�5�5�h�Z�5�P�Q�RS�T�T���	��	�s�%A&�&
A3�2A3c��[RURURUR5nX"URU4UR
U'U$)z�Convert an entry to a directory.

:param this_ie: Inventory entry
:param inv_path: Normalized path for the inventory entry
:return: The new inventory entry
)rP�InventoryDirectoryrr rrr)r&�this_ierxs   r(�_convert_to_directory�%_SmartAddHelper._convert_to_directory�sI��!�3�3��O�O�W�\�\�7�+<�+<�
��%-�����#Q����x� ��r*c���[R"U5n[R"U5upgUc*URU5nUbU$UR	SUSU5nUR
S:waUR
X5nURURXU5n	[RX7URU	S9n
SXJRU
4URU'URRU5 U
$)a�Add a new entry to the inventory and automatically add unversioned parents.

:param parent_ie: Parent inventory entry if known, or None.  If
    None, the parent is looked up by name and used if present, otherwise it
    is recursively added.
:param path: Filesystem path to add
:param kind: Kind of new entry (file, directory, etc)
:param inv_path: Inventory path
:return: Inventory entry for path and a list of paths which have been added.
Nr��r)r
�dirname�splitry�_add_one_and_parentr!r~rGrrP�
make_entryrrrrDr�)r&�	parent_ierr!rx�inv_dirnamer��basenamer}rr�s           r(r��#_SmartAddHelper._add_one_and_parent�s����o�o�h�/��#�M�M�$�/������l�l�8�,�G��"���
�0�0��g�{�K��I��>�>�[�(��2�2�9�J�I��+�+�d�i�i��$�?���)�)��I�-�-�w�*�
��%)�(�M�M�5�#I����x� ��
�
���(�#��r*c#�# �Sn[Rn[U5H$nUbU"U/U5(d
XupVXEUS4v� UnM& g7fr3)r
�is_inside_or_parent_of_any�sorted)r&�	user_dirs�prev_dir�	is_insiderrxr}s       r(�_gather_dirs_to_add�#_SmartAddHelper._gather_dirs_to_add%sV������6�6�	��9�%�D���y�(��T�'B�'B�$-�O�!���w��5�5��H�	&�s�AA	Nc��XlUc[R5UlOX l0Ul/Ul0UlUc[5UlgX0lgr3)	rrt�	AddActionrGrrrDrE�	frozensetrI)r&rrGrIs    r(r%�_SmartAddHelper.__init__1sI���	��>��-�-�/�D�K� �K������
�����$�%.�[�D�"�%6�"r*c��	�U(dS/nURR5(a#[[[R
U55n0n[R"URRU5H�nURRU5(a[R"US9eURRU5n[R"U5n[R"U5upxURU5n	U	cURSXFU5n	US:XdM�Xy4X4'M� U(dg[UR!U55n
["R$"S5nU
GHNup�p�URRU5nSnU	c7[R&"U5n[R("UR*5nOU	R,nUR.R1URXVU5(aM�[2R4R7U5(d[8R:"SXV5 M�UR=U5(a([8R:"SR?U55 GMX�R@;a[8R:"SU5 GM<US:Xa?US:wa9[BRD"U5n[FRHRKU5 S	nOS
nU	bO1U(a[8R:"SU5 OURX�Xg5n	US:XdGM�U(aGM�U	R,S:waURQX�5n	[S[TRV"U55GH>n[R"U5unn[RX"UU5nURRU5(a[8RZ"SU5 Mm[RX"UU5nUR\R_U5nUbUS
nOU	R`R_U5nUbU
RcUUUU	45 M�URReU5nUb.URfRiU/5RcU5 GM)U
RcUUSU	45 GMA GMQ g![RLa S
nGN�[RNa S	nGNf=f)N�.r^r�z[\r\n]z)skipping %s (can't add file of kind '%s')z!skipping {!r} (contains \n or \r)z1skipping %s (generated to help resolve conflicts)r�TFzskipping nested tree %rzskip control directory %rru)5rr\r�mapr
�
normalizepath�canonical_relpaths�basedirrcrrd�abspath�	file_kind�normalized_filenameryr�r��re�compile�	file_stat�file_kind_from_stat_mode�st_moder!rG�	skip_filerP�InventoryEntry�versionable_kindr�warning�searchr,rIr��get_transport_from_pathr�ControlDirFormat�find_formatr��UnsupportedFormatErrorr~r��os�listdirr��mutterrrrwr�r��
is_ignoredrE�
setdefault)r&rFr�r��filepathr�r!rx�_r}�
things_to_add�illegalpath_rer�r��
stat_valuer
�sub_tree�subf�inv_fr��sub_invpr��sub_ie�ignore_globs                        r(rt�_SmartAddHelper.add?s�����I�
�9�9�&�&�(�(��S��!6�!6�	�B�C�I��	�
 �2�2�4�9�9�3D�3D�i�P�H��y�y�,�,�X�6�6��6�6��I�I��i�i�'�'��1�G��$�$�W�-�D�
"�5�5�h�?�K�H��l�l�8�,�G����2�2�4���R���{�"�'/�&9�	�#�%Q�(���T�5�5�i�@�A�
����I�.��7D�3�I���i�i�'�'�	�2�G��J���$�.�.�w�7�
��7�7�
�8J�8J�K���|�|���{�{�$�$�T�Y�Y��z�J�J��!�0�0�A�A�$�G�G��
�
�?�����$�$�Y�/�/��
�
�C�J�J�7�S�T���2�2�2��
�
�G�����{�"�y�B��$� .� F� F�w� O�I��/�/�;�;�I�F�#�H�!���"����
�
�7��A��2�2�9��X���{�"�8�8��<�<�;�.�"�8�8��K�G�"�2�:�:�g�#6�7�D�&�:�:�4�@�H�E�1�#�+�+�I�t�<�D�
�y�y�4�4�T�:�:����%@�$�G� �&�/�/��%�@�H� �N�N�.�.�x�8�E��(�!&�q���!(�!1�!1�!5�!5�e�!<���)�%�,�,�d�H�f�g�-N�O�
'+�i�i�&:�&:�4�&@��&�2� �L�L�3�3�K��D�K�K�D�Q�)�0�0�$��$��1P�Q�;8�C8E��N�,�,�%�$�H��4�4�$�#�H�$�s�57S�S2�S2�1S2)rrrGrDrIrErr3�T)
r-rOrPrQrrCryr~r�r�r%rtrTr[r*r(rBrB�s+��+�-�
�"
�)�V
�7�KRr*rBc���\rSrSrSrSrSrSrSSjrSr	S	r
S
rSSjrSSjr
SS
jrSrSrSrSrSrSrSrSSjrSr\R24SjrSrSrSrSrg) rRi�c�>�[R"XU5 X lgr3)rr%re)r&r�r�r�s    r(r%�InventoryRevisionTree.__init__�s�����d��<��r*c��URU5nURRnXcR;aURR	U5 U$)r�)r��_repositoryr�r�r�)r&rrr�r�r�r�s       r(r��(InventoryRevisionTree._get_file_revision�sI���.�.�t�4�
��"�"�(�(���4�4�4��&�&�-�-�g�6��r*c���URU5nURRUR5nUR$![R
an[
U5UeSnAff=fr3)r�r��get_revisionrr�NoSuchRevisionr�	timestamp)r&rr�rr�s     r(�get_file_mtime�$InventoryRevisionTree.get_file_mtime�sb��
�]�]�4�
 ��	8��'�'�4�4�R�[�[�A�H��!�!�!���$�$�	8�*�4�0�a�7��	8�s�%A�A)�A$�$A)c�8�URU5R$r3)r��	text_sizer�s  r(�
get_file_size�#InventoryRevisionTree.get_file_size�s���}�}�T�"�,�,�,r*Nc�^�URU5nURS:XaUR$g)N�file)r�r!�	text_sha1)r&rr�r�s    r(�
get_file_sha1�#InventoryRevisionTree.get_file_sha1�s)��
�]�]�4�
 ��
�7�7�f���<�<��r*c�8�URU5R$r3)r�rr�s  r(r��'InventoryRevisionTree.get_file_revision�s���}�}�T�"�+�+�+r*c�^�URU5nURS:wagUR$)Nr�F)r�r!r"r�s   r(�
is_executable�#InventoryRevisionTree.is_executable�s)��
�]�]�4�
 ��
�7�7�f����}�}�r*c�6�[URU55$r3)�boolr�)r&r_s  r(�has_filename�"InventoryRevisionTree.has_filename�s���D�L�L��*�+�+r*c�D�Ub&URU5nURU5SnOW[R"URR
R
U55nUR5R5nUcg[RRXSS9$)Nr)�possible_transports)r��get_reference_infor�open_from_transportr��user_transport�clone�open_branch�
get_parent�_mod_branch�Branch�open)r&rrr�r�
parent_url�subdirs       r(�reference_parent�&InventoryRevisionTree.reference_parent�s������l�l�4�(�G��2�2�7�;�A�>�J��3�3�� � �/�/�5�5�d�;��F� �+�+�-�8�8�:�J�����!�!�&�&��'�
�	
r*c�H�URURU55S$)Nr)r�r�)r&rrs   r(r��(InventoryRevisionTree.get_reference_infos!���(�(����d�);�<�Q�?�?r*c#�# �UcSnURnOURU5upeUcgURXSS9nURbU(dUc[	U5 UH�up�U	R
S:XapU(aiUR
X�RU	R5n
U
RSUUS9H,up�p�U(a[R"X�5nOUnX�X�4v� M. M�USU	R
U	4v� M� g7f)N)�from_dir�	recursiver�T)�include_rootr�r��V)rlr�r�r�r0r!r�rr��
list_filesr
r�)r&r�r�r�r��from_dir_idr��entriesrr�r��subpath�statusr!�full_subpaths               r(r�� InventoryRevisionTree.list_files	s������K��%�%�C�#�5�5�h�?��C��"���"�"�K�"�M���8�8����9I���M�"�K�D��z�z�-�-�.��/�/��-�-��)A�)A���5<�4F�4F�!%�#1�'�5G�5�0�G�T�
�'.�'7�'7��'F��'+��&��;�;�5��C����U�2�2�!#�s�C9C;c�8�URU5R$r3)r��symlink_targetr�s  r(�get_symlink_target�(InventoryRevisionTree.get_symlink_target+s���}�}�T�"�1�1�1r*c�8�URU5R$r3)r�r�r�s  r(�get_reference_revision�,InventoryRevisionTree.get_reference_revision/s���}�}�T�"�5�5�5r*c���[R"URRR	U55nUR5nURU5nUb=X'RS5:wa)[SRX'RS555eU$![
Ran[U5UeSnAff=f![
Ran[U5UeSnAff=f)Nr�zinvalid root id: {!r} != {!r})rr�r�r�r�rr�r�find_repositoryr�r�r�r�r,)r&rrr�r�r��subrepo�revtrees        r(r��&InventoryRevisionTree._get_nested_tree2s���	1��3�3�� � �/�/�5�5�d�;��F�
�(�(�*��	1��+�+�,>�?�G���7�o�o�b�.A�#A� �/�6�6�w���PR�@S�T��
�����$�$�	1�#�D�)�q�0��	1��
�$�$�	1�#�D�)�q�0��	1�s/�9B�C�C�3B?�?C�C,�C'�'C,c�J�URU5nURUSU5$r3)r�r�)r&r�nested_revids   r(r��%InventoryRevisionTree.get_nested_treeEs'���2�2�4�8���$�$�T�4��>�>r*c�8�URU5R$r3)r�r!r�s  r(r!�InventoryRevisionTree.kindIs���}�}�T�"�'�'�'r*c��URU5nURnUS:Xa#X2RUR
UR4$US:XaUSSUR4$USSS4$![Ra gf=f)zSee Tree.path_content_summary.)�missingNNNr�r)N)r�r�r�r!r�r"r�r�)r&rr�r!s    r(�path_content_summary�*InventoryRevisionTree.path_content_summaryLs���	1��M�M�$�'�E��z�z���6�>��/�/�5�+;�+;�U�_�_�M�M�
�Y�
��$��e�&:�&:�;�;��$��d�+�+���(�(�	1�0�	1�s�A$�$A;�:A;c�<�UcgURURS4$)N)NFN)r!r")r&r�rs   r(�_comparison_data�&InventoryRevisionTree._comparison_dataZs!���=�$��z�z�5�+�+�T�1�1r*c#�# �SnURU5up4Uc/nOX4/nU(a�/nUR5upxU(aUS-n	OSn	URU5n
/nU
R5H`up�X�-nUR	X�U
R
SU
R
45 U
R
U:XdMDUR	X�R45 Mb Xv4v� UR[U55 U(aM�gg7f)Nr�r�r�)	r��pop�	get_entry�sorted_childrenr�r!r�extend�reversed)r&�prefix�
_directoryr��top_idr�dirblockr�r�relrootr��subdirsr r�toppaths               r(�walkdirs�InventoryRevisionTree.walkdirs_s���� �
��,�,�V�4����>��G��'�(�G���H�#�K�K�M�M�D����*�����M�M�'�*�E��G�$�4�4�6���!�.�������
�
�D�%�*�*� M�N��:�:��+��N�N�G�]�]�#;�<�	 7�
�.� ��N�N�8�G�,�-�#�g�s�B-C=�3AC=�;C=c#�L# �UVVs/sH(up#URU5URU5U4PM* nnnURRU5Shv�N gs snnfN![R
a&n[R"UR5UeSnAff=f7f)z^See Tree.iter_files_bytes.

This version is implemented on top of Repository.iter_files_bytes
N)	r�r�r��iter_files_bytesr�RevisionNotPresentr�r�r)r&�
desired_filesr��i�repo_desired_filesr�s      r(r"�&InventoryRevisionTree.iter_files_bytesys����IV�
�HU���T�\�\�!�_�d�4�4�Q�7��;�
�	�
�	>��'�'�8�8�9K�L�L�L��	
�
M���(�(�	>� �+�+�A�I�I�6�A�=��	>�sD�B$�/A�B$�A'�A%�A'�B$�%A'�'B!�;!B�B!�!B$c��URU5nX0RU54nURRR	5nURU5nUVVs/sHupxUSU4PM snn$s snnf)zSee Tree.annotate_iter.���)r�r�r�r��
get_annotator�
annotate_flat)	r&r�default_revisionr�text_key�	annotator�annotations�key�lines	         r(�
annotate_iter�#InventoryRevisionTree.annotate_iter�so���,�,�t�$���3�3�D�9�:���$�$�*�*�8�8�:�	��-�-�h�7��1<�=��I�C��R��$���=�=��=s�A5c�j�XLag[U[5(aURUR:H$g�NTF)r7rRrlr9s  r(r;�InventoryRevisionTree.__eq__�s2���=���e�2�3�3��&�&�%�*>�*>�>�>�r*c��X:X+$r3r[r9s  r(�__ne__�InventoryRevisionTree.__ne__�s���"�"r*c��[S5e)Nznot hashable)rkr/s r(�__hash__�InventoryRevisionTree.__hash__�s
����(�(r*rdr3r�)FNTF)r�)r-rOrPrQr%r�r�r�r�r�r�r�r�r�r�r�r�r�r�r!r
rrr"r�CURRENT_REVISIONr2r;r8r;rTr[r*r(rRrR�s�����"�-��,��,�

�@�QV� 3�D2�6��&?�(�,�2�
.�4>�4<�3L�3L�>��#�)r*rRc�t�\rSrSrSr\S5rSrSSjr\	S5r
S
SjrSS	jrSS
jr
Srg)�InterInventoryTreei�z3InterTree implementation for InventoryTree objects.c�P�[U[5=(a [U[5$r3)r7rW)�kls�source�targets   r(�
is_compatible� InterInventoryTree.is_compatible�s���&�-�0�V�Z��
�5V�Vr*c
�r�UcUcgURnOURnUb9SnURnURnURR	X5up�nO
SnSnSnSn	Sn
Ub:SnURn
URnUR
R	X$5unnnO
SnSn
SnSnSnXl4nX�4nSnX�:waSnO�U	S:XaUR
X4WW5(dSnO�U	S:Xa;URRU5UR
RU5:waSnO@U	S:Xa:URRU5UR
RU5:waSnX�4nX}4nU
U4nUSLd0USUS:wd$USUS:wdUSUS:wdUSUS:waSnOSn[UX44UUUUUU5U4$)	a�Generate a iter_changes tuple between source_entry and target_entry.

:param source_entry: An inventory entry from self.source, or None.
:param target_entry: An inventory entry from self.target, or None.
:param source_path: The path of source_entry.
:param target_path: The path of target_entry.
:return: A tuple, item 0 of which is an iter_changes result tuple, and
    item 1 is True if there are any changes in the result tuple.
NTFr�r)r�rrB)
rr rrBrrC�file_content_matchesr�r�r)r&�source_entry�target_entry�source_path�target_pathr�source_versioned�source_name�
source_parent�source_kind�source_executable�source_stat�target_versioned�target_name�
target_parent�target_kind�target_executable�target_statrr!r�parentr r"r#s                         r(�_changes_from_entries�(InterInventoryTree._changes_from_entries�sD�����#��"�*�*�G�"�*�*�G��#�#��&�+�+�K�(�2�2�M�:>�+�+�:V�:V��;�7�K�K� %���K� �M��K� $���#�#��&�+�+�K�(�2�2�M�:>�+�+�:V�:V��;�7�K�*�K� %���K� �M��K� $��%�8�	��)�����%�"�O�
�F�
"��,�,��+�{���#'���
�I�
%��{�{�-�-������/�/��<�=�#'���
�,�
,��{�{�1�1������3�3�K�@�A�#'���/���)��'�):�;�
��5�(���|�y��|�+��a�y�F�1�I�%��A�w�$�q�'�!��!�}�
�1�
�-��G��G�"��
�&�������	
��	�		r*Nc#�"
# �Uc/nU(d/nO[U5n[5n/nU/:Xa/n	/n
ORURRUUR/U-US9n	URRUUR/U-US9n
Ub[5n[5nU(aq[URR
5V
s/sH6n
Ub[R"X-5(dM#U
RS5U
4PM8 sn
5n[U5nO
[5n0n[URRU
S95n[U5n[URRU	S95nURUV
Vs/sHun
nU
PM
 snn
5n[U5[U5-nSn[5nUGH�unnU(a�USSURS5:a|UR!5nURR#UUS5unnn[%SSUS4SSS	SUSS
4SU4SU45v� U(aUSSURS5:aM|UUnUbUR'U5nOSnUR)UUUUS9un n!U R*SUU R,'US-
nU R.S(aUS-
nUbUR1SUU5 U!(dU(a@Ub9UR3U R4S5 UR7U R,5 U v� UcGMzU R8SS
:XaWR3U R,5 U R.S(aU R;5(dGM�WR3U R4S5 GM� U(aaUR!5nURR#UUS5un"n#n$[%SSUS4SSS	SUSS
4SU"4SU#45v� U(aMaUH�un%n&U&R,n'U'U;aMUR=U%5n(US-
nUbUR1SUU5 Sn)U&R4S4n*U&R>S4n+URR#U&U%5un,n-n.U,S4n/U-S4n0U,SLn1UR7U'5 [%U'U%U(4U1U)U*U+U/U05v� M� [U5nUbURAXx5Hn U v� M	 ggs sn
fs snn
f7f)a�Generate an iterator of changes between trees.

A tuple is returned:
(file_id, (path_in_source, path_in_target),
 changed_content, versioned, parent, name, kind,
 executable)

Changed_content is True if the file's content has changed.  This
includes changes to its kind, and to a symlink's target.

versioned, parent, name, kind, executable are tuples of (from, to).
If a file is missing in a tree, its kind is None.

Iteration is done in parent-to-child order, relative to the target
tree.

There is no guarantee that all paths are in sorted order: the
requirement to expand the search due to renames may result in children
that should be found early being found late in the search, after
lexically later results have been returned.
:param require_versioned: Raise errors.PathsNotVersionedError if a
    path in the specific_files list is not versioned in one of
    source, target or extra_trees.
:param specific_files: An optional list of file paths to restrict the
    comparison to. When mapping filenames to ids, all matches in all
    trees (including optional extra_trees) are used, and all children
    of matched directories are included. The parents in the target tree
    of the specific files up to and including the root of the tree are
    always evaluated for changes too.
:param want_unversioned: Should unversioned files be returned in the
    output. An unversioned file is defined as one with (False, False)
    for the versioned pair.
Nrpr�rvrrBT)FFr�r))rJrKzcomparing filesr�)TF)!rrsrCr{rBr��extrasr
�
is_inside_anyr�rr��dict�find_source_pathsrjr�popleftrrrwrYrrrrrtrr�r!rG�find_target_pathr �_handle_precise_ids)2r&�include_unchangedr�r�extra_treesrq�want_unversioned�precise_file_ids�changed_file_ids�target_specific_files�source_specific_files�seen_parents�	seen_dirsr��all_unversioned�to_paths�from_entries_by_dir�	from_data�to_entries_by_dirr��path_equivs�num_entries�entry_count�
fake_entryrKrI�unversioned_pathrUrVrWrJrH�resultr#�to_kind�
to_executable�to_statr�
from_entryr�to_pathrrXr �	from_kind�from_executabler�r!r"rs2                                                  r(r/�InterInventoryTree.iter_changes�s����T���K���K��{�+�K��5�����R��$&�!�$&�!�$(�K�K�$O�$O�����
��+�"3�%P�%�!�
%)�K�K�$O�$O�����
��+�"3�%P�%�!�
�%��5�L���I��$�"�[�[�/�/�1��1��%�-��,�,�^�?�&�Q�W�W�S�\�1�%�1���O�$�O�4�O�#�g�O���"��K�K�+�+�;P�+�Q�
���,�-�	� ��K�K�+�+�;P�+�Q�
���,�,�<M�-N�<M�D�A�q�a�<M�-N�O���-�.��5F�1G�G�����Z�
�):�%�K��!�o�a�&8��&;�k�>O�>O�PS�>T�&T�#2�#:�#:�#<� ��K�K�0�0��=M�a�=P�Q�<��.��*���+�A�.�/��"� ��+�A�.�r�2�3��;�'��,�-�	�	�"�o�a�&8��&;�k�>O�>O�PS�>T�&T�&�k�2�K��&�(�}�}�[�9��#��"�8�8���'�'�	9��O�F�G�(.�{�{�1�~�H�V�^�^�$��1��K�����"��q� ���~��	�	�+�[�+�F��+�!�-�$�(�(��)9�)9�!�)<�=�$�+�+�F�N�N�;����)��;�;�q�>�[�0��M�M�&�.�.�1��'�'��*�f�.B�.B�.D�.D� �$�$�V�%5�%5�a�%8�9�[*;�\�.�6�6�8��.2�k�k�.J�.J��,�Q�/�/�+�G�]�G�&���'��*�+�����'��*�2�.�/��w���}�%�	�	
�
�o�"!4��D�*� �(�(�G��(�"���+�+�D�1�G��1��K��~��	�	�+�[�+�F�%�I� �*�*�D�1�F��O�O�T�*�D�59�[�[�5Q�5Q��D�6�2�I��
��t�$�D�)�4�0�J�'�t�3�O��#�#�G�,�%���w��������	�	
�)!4�<�/�0���%��2�2�3C�V����W�&��o��$.O�sB�CT�"T�+T�A>T�T	
�CT�!CT�6AT�B	T�C4Tc�`�URU/S9n[U5S$![a gf=f)a%Get an inventory entry from a tree, with missing entries as None.

If the tree raises NotImplementedError on accessing .inventory, then
this is worked around using iter_entries_by_dir on just the file id
desired.

:param tree: The tree to lookup the entry in.
:param path: The path to look up
rvrBN)r�r0r1)rr�iterators   r(�
_get_entry�InterInventoryTree._get_entry�s=��	��/�/��v�/�F�H���>�!�$�$���	��	�s� �
-�-c#�^# �U(GaGURS5 URU5 U(dg/nUH.nURURR	U55 M0 UH/nURRU5nURU5 M1 URS5 Un[5nUGH�n	U(aURU	5n
SnOSn
U
c�URR	U	5nURURU5nURR	U	5n
URURU
5nURX�X�5up�OSnU
RSnURU5 U(dM�U
RSS:Xa}U
RSS:wajWc)URURU
R S5nUR#SURR%U
R S555 URU
R&5 U
v� GM� U(aGMFgg![
Ra GM2f=f![
Ra SnSnGNof=f![
Ra Sn
SnGNVf=f7f)a�Fill out a partial iter_changes to be consistent.

:param precise_file_ids: The file ids of parents that were seen during
    the iter_changes.
:param changed_file_ids: The file ids of already emitted items.
:param discarded_changes: An optional dict of precalculated
    iter_changes items which the partial iter_changes had not output
    but had calculated.
:return: A generator of iter_changes items to output.
NTrBrr�c3�:# �UHnURv� M g7fr3r�)�.0rs  r(�	<genexpr>�9InterInventoryTree._handle_precise_ids.<locals>.<genexpr>&s���0�)W��"�M�M�)W�s�)�discard�difference_updater�rCrurrvrBr�rtrsrwr�rYrr!rrr�r)r&rfrg�discarded_changesrwrr�old_id�current_idsrrvrHrJrKrIr#�
new_parent_ids                 r(rb�&InterInventoryTree._handle_precise_ids�sh��� ��$�$�T�*��.�.�/?�@�#���E�-�	���L�L����!4�!4�Y�!?�@�.������,�,�T�2�� �$�$�V�,��
�$�$�T�*�*�K�"�u��'��$�.�2�2�7�;�F�#'�L�!�F��>�Q�&*�k�k�&9�&9�'�&B��
(,���t�{�{�K�'P��Q�&*�k�k�&9�&9�'�&B��
(,���t�{�{�K�'P��&*�&@�&@�$�K�'�O�F�G�#�G� &� 0� 0�� 3�
� �$�$�]�3��7��{�{�1�~��4����Q��;�9V�(�/�+/�?�?�4�;�;����TU��+W�L�(�/�/�0�)-���)G�)G����TU��)W�0��%�(�(����8� �L�U'�7��������	��0"�?�?�,�&*��'+��,��"�?�?�,�&*��'+��,�s�:J-�*I�'A<J-�$I/�?J-�J�7AJ-�B;J-�J-�I,�'J-�+I,�,J-�/J�J-�
J�J-�J*�&J-�)J*�*J-c���URRU5nUc[R"U5eURRX2S9$![Ra gf=f)z�Find target tree path.

:param path: Path to search for (exists in source)
:return: path in target, or None if there is no equivalent path.
:raise NoSuchFile: If the path doesn't exist in source
Nr?)rBr�r�r�rCrurrv�r&rr�rs    r(ra�#InterInventoryTree.find_target_path-�a���+�+�%�%�d�+���?� �+�+�D�1�1�	��;�;�&�&�w�&�@�@�����	��	���A�A&�%A&c���URRU5nUc[R"U5eURRX2S9$![Ra gf=f)z�Find the source tree path.

:param path: Path to search for (exists in target)
:return: path in source, or None if there is no equivalent path.
:raise NoSuchFile: if the path doesn't exist in target
Nr?)rCr�r�r�rBrurrvr�s    r(�find_source_path�#InterInventoryTree.find_source_path<r�r�r[�FNNNTFr3)�none)r-rOrPrQrrrDrYr/�staticmethodr�rbrar�rTr[r*r(r?r?�sg��=��W��W�
V�t ������E�N����$EI�U!�n
�
r*r?c�>�\rSrSrSr\S5rSSjrSrg)�InterCHKRevisionTreeiOz;Fast path optimiser for RevisionTrees with CHK inventories.c���[U[5(aC[U[5(a.URR URR gg![a gf=fr5)r7rrl�id_to_entry�AttributeError)rBrCs  r(rD�"InterCHKRevisionTree.is_compatibleRs]���f�l�+�+�
�6�<�0P�0P�
��%�%�1�1��%�%�1�1����"�
���
�s�,A�
A'�&A'Nc#�# �Uc/nUR/nU(aURU5 [5n0n	U/:Xa/n
OURR	X'US9n
[5nURR
R
URR
5Hkn[U6nU
b>URU
;aX�UR'M.URURS5 Uv� URUR5 Mm U
bURX�U	S9HnUv� M	 U(a�[U5nURR
R5H�up�U
bURU
;aMURU;dM,[URX�4SSURUR4URUR4URUR4URUR45v� M� gg7f)NrprB)r�FrA)rBrrsrCrrrlr/rrrtrrbr�r r!r")r&rcr�rrdrqre�lookup_treesrfr�r�rgrv�relpathr�s               r(r/�!InterCHKRevisionTree.iter_changes^s�������K����}�������,��5�����R�� "�� $��� 5� 5��@Q�!6�!���5���k�k�0�0�=�=��K�K�&�&�
�F�)�&�1�F� �,��>�>�):�:�9?�f�n�n�5�� �$�$�V�%5�%5�a�%8�9��L�� � ����0�
��(��2�2� �FW�3������� #�#3�4��"&�+�+�"<�"<�"I�"I�"K���%�1��
�
�->�>���=�=�(8�8�-��
�
� �*��$����%�/�/�:����U�Z�Z�0����U�Z�Z�0��)�)�5�+;�+;�<�	�	�#L��s
�FH�A=Hr[r�)	r-rOrPrQrr�rDr/rTr[r*r(r�r�Os1��E��	��	� ������Fr*r�r�))rr�r��collectionsrr�rr�rrrr	r
rrr
r�r�mutabletreer�revisiontreer�globalsrrrrrrrrrWr~rrrrBrRr?�register_optimiserr�r[r*r(�<module>r�s���"=�	�	��$�O�O�O�*�#�%�'�����I��
���Q
�*�Q
�h_-�D�_-�D	B�&�6�>Y-�;�
�Y-�xxR�xR�vL)�L�-�L)�^m��m�`

���/�0�U�-�U�p
���1�2r*

Youez - 2016 - github.com/yon3zu
LinuXploit