403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.224
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__/transform.cpython-313.pyc
�

p��gޕ����SSKrSSKrSSKrSSKrSSKrSSKJrJr SSKJ	r	J
r
JrJrJ
r
JrJrJrJr SSKJr SSKJr SSKJrJr SSKJr SS	KJr SS
KJr SSKJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/ SSKJ0r0 S
SKJ1r1J2r2 S
SK3J4r4 Sr5"SS\(5r6Sr7Sr8Sr9\7\9\8S.r:Sr;"SS\65r<"SS\<5r="SS\=5r>"SS\%\2R~5r@S$S jrAS!rBS"rCS#rDg)%�N)�S_IEXEC�S_ISREG�)	�annotate�
controldir�errors�multiparent�osutils�trace�tree�ui�urlutils)�revision)�	transport)�ContentFilterContext�filtered_output_bytes)�gettext)�MutableTree)�
ProgressPhase)�ROOT_PARENT�
FinalPaths�
ImmortalLimbo�MalformedTransform�NoFinalPath�PreviewTree�ReusingTransform�TransformRenameFailed�
TreeTransform�
_FileMover�_reparent_children�_TransformResults�joinpath�new_by_entry�resolve_conflicts�
unique_add)�find_previous_path�)�	inventory�
inventorytree)�Conflictc���URU:wagURS:XagURS:Xa^[US5oPR"U5n[R"XV5(aSSS5 SSS5 gSSS5 SSS5 gURS:Xa+UR
"U5[R"U5:Xagg!,(df   NS=f!,(df   g=f)NF�	directoryT�file�rb�symlink)�kind�open�get_filer
�
compare_files�get_symlink_target�os�readlink)r�entry�	tree_pathr0�target_path�f1�f2s       �6/usr/lib/python3/dist-packages/breezy/bzr/transform.py�_content_matchr=As����z�z�T����z�z�[� ���z�z�V��
�+�t�
$��M�M�)�,D���$�$�R�,�,��-E�
$�
$�,�-E�
$��
���y�	 ��"�"�9�-����[�1I�I���
-E�,D��
$�
$��s)�C�C
�.C�C�
C	�C�
C,c�^�\rSrSrSrS8U4SjjrSrSr\"\5r	Sr
SrSrS	r
S9S
jrSrS:SjrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"S;Sjr#S9S jr$S9S!jr%S"r&S#r'S$r(S%r)S&r*S'r+S(r,S)r-S<S*jr.S+r/S,r0S-r1S.r2S/r3S=S0jr4S1r5S2r6S3r7S4r8S>S5jr9S6r:S7r;U=r<$)?�TreeTransformBase�Pz-The base class for TreeTransform and its kin.c��>�[TU]XS9 0Ul0Ul0Ul0UlUR"S5(aURS5UlOSUlX0l	g)z�Constructor.

:param tree: The tree that will be transformed, but not necessarily
    the output tree.
:param pb: ignored
:param case_sensitive: If True, the target of the transform is
    case sensitive, not just case preserving.
)�pb�N)
�super�__init__�_observed_sha1s�_new_id�_non_present_ids�	_r_new_id�is_versioned�trans_id_tree_path�	_new_root�_case_sensitive_target)�selfrrB�case_sensitive�	__class__s    �r<rE�TreeTransformBase.__init__Ssc���	�����%�!������ "���������R� � �!�4�4�R�8�D�N�!�D�N�&4�#�c��URcg[RSHnU"URU5 M URR5 SUlg)z~Release the working tree lock, if held.

This is required if apply has not been invoked, but can be invoked
even after apply.
N�post_transform)�_treer�hooks�unlock)rN�hooks  r<�finalize�TreeTransformBase.finalizemsL���:�:����%�%�&6�7�D�����T�"�8��
�
������
rRc��UR$�N)rL�rNs r<�
__get_root�TreeTransformBase.__get_rootzs���~�~�rRc�~�UR5n[URX15 [URX25 U$)z&Assign a transaction id to a new path.)�	assign_idr%�	_new_name�_new_parent)rN�name�parent�trans_ids    r<�create_path�TreeTransformBase.create_paths1���>�>�#���4�>�>�8�2��4�#�#�X�6��rRc��URnURU5nURU5HmnXR:wa1URUR	U5URU5U5 URU5nUbUR
U5 URXVS9 Mo URRS5 URRU5 URS5UlX#:XaURnURXU5 URU5 URX4S9 UR
UR5 g)aNEmulate moving the root by moving all children, instead.

We do this by undoing the association of root's transaction id with the
current tree.  This allows us to create a new directory with that
transaction id.  We unversion the root directory and version the
physically new directory, and hope someone versions the tree root
later.
N��file_idrC)
rL�
final_file_id�iter_tree_children�adjust_path�
final_name�final_parent�unversion_file�version_file�_tree_path_ids�pop�_tree_id_pathsrK�create_directory)rNrdre�old_root�old_root_file_id�child_idrks       r<�adjust_root_path�"TreeTransformBase.adjust_root_path�s%���>�>���-�-�h�7���/�/��9�H��!�� � ��O�O�H�-�t�/@�/@��/J�H���(�(��2�G��"��#�#�H�-����h��8�:�	
������#�������)��0�0��4������^�^�F�����x�0����h�'����(��=����D�N�N�+rRc��URR5VVs/sHupU[:XdMUPM nnn[U5S:ag[U5S:wa[	S5eUR
cUSUlgUSnUR
UR
5cURU5nOURUR
5nX@R;aURU5 OURU5 URUR
5b5UR
UR;aURUR
5 UbURUR
US9 [URU55 UR!5R#U/5H/nUR%UR'U5UR
U5 M1 X@R(;aUR+U5 OUR-U5 UR
UR.;aUR1UR
5 URU	UR2U	gs snnf)aiReinterpret requests to change the root directory.

Instead of creating a root directory, or moving an existing directory,
all the attributes and children of the new root are applied to the
existing root directory.

This means that the old root trans-id becomes obsolete, so it is
recommended only to invoke this after the root trans-id has become
irrelevant.

r'NzA tree cannot have two roots!rrj)rc�itemsr�len�
ValueErrorrL�
final_kindrlrG�cancel_versioningrq�tree_file_id�_removed_idrr�listrm�	by_parent�getrnro�
_new_contents�cancel_creation�delete_contents�_removed_contents�cancel_deletionrb)rN�k�v�	new_roots�old_new_rootrk�childs       r<�fixup_new_roots�!TreeTransformBase.fixup_new_roots�s���$(�#3�#3�#9�#9�#;�P�#;�4�1�q�K�?O�Q�#;�	�P��y�>�A����y�>�Q���<�=�=��>�>�!�&�q�\�D�N�� ��|���?�?�4�>�>�*�2��(�(��6�G��(�(����8�G��<�<�'��"�"�<�0�����-�
���d�n�n�-�9����d�&6�&6�6�������/������d�n�n�g��>�
	
�T�
$�
$�\�
2�3��^�^�%�)�)�,��;�E����T�_�_�U�3�T�^�^�U�K�<��-�-�-�� � ��.�� � ��.��>�>�T�3�3�3�� � ����0�
���\�*��N�N�<�(��aQs
�I�Ic��Uc[S5eXR;aURUbURU$URRU5nUR	U5$![
RaC XR;aURUs$UR5nX0RU'Us$f=f)aDetermine or set the transaction id associated with a file ID.
A new id is only created for file_ids that were never present.  If
a transaction has been unversioned, it is deliberately still returned.
(this will likely lead to an unversioned parent conflict.).
zNone is not a valid file id)	rrIrU�id2pathrKr�NoSuchIdrHra)rNrk�pathrfs    r<�trans_id_file_id�"TreeTransformBase.trans_id_file_id�s����?��:�;�;��n�n�$�����)@�)L��>�>�'�*�*�

5��z�z�)�)�'�2���.�.�t�4�4���?�?�
$��3�3�3��0�0��9�9�#�~�~�/�H�5=�)�)�'�2�#�O�

$�s�A*�*2C� C�Cc�,�[UR5e)�$Schedule a file to become versioned.)�NotImplementedErrorrr�rNrfrks   r<rr�TreeTransformBase.version_file�s��!�$�"3�"3�4�4rRc�,�[UR5e)�%Undo a previous versioning of a file.)r�r��rNrfs  r<r��#TreeTransformBase.cancel_versionings��!�$�"8�"8�9�9rRc�N�[5nU(a�URRUR5nUR	UR
5 UR	UR5 UR	UR5 URRU5nX@R4nO9URUR
URURUR4nUHnURU5 M [[U5RU55$)z�Determine the paths of all new and changed files.

:param filesystem_only: if True, only calculate values for files
    that require renames or execute bit changes.
)
�set�
_needs_rename�
differencerb�difference_updatercr�rG�_new_executability�update�sortedr�	get_paths)rN�filesystem_only�new_ids�	stale_ids�needs_rename�id_sets�id_sets       r<�	new_paths�TreeTransformBase.new_pathss����%����*�*�5�5�d�n�n�E�I��'�'��(8�(8�9��'�'��(:�(:�;��'�'����5��-�-�8�8��C�L�#�%<�%<�=�G����� � ��"�"�����'�'��G��F��N�N�6�"���j��&�0�0��9�:�:rRc��URU5nUcgURU:XaURRS5$URRU5$)z?Determine the file id associated with the trans_id in the tree.NrC)r8rLrU�path2id�rNrfr�s   r<r��TreeTransformBase.tree_file_idsN���~�~�h�'���<���>�>�X�%��:�:�%�%�b�)�)��z�z�!�!�$�'�'rRc�(�URU5SL$r\)rlr�s  r<�final_is_versioned�$TreeTransformBase.final_is_versioned(s���!�!�(�+�4�7�7rRc��URU$![a XR;agOf=fURU5$)z�Determine the file id after any changes are applied, or None.

None indicates that the file will not be versioned after changes are
applied.
N)rG�KeyErrorr�r�r�s  r<rl�TreeTransformBase.final_file_id+sL��	��<�<��)�)���	��+�+�+��,�	��� � ��*�*s��/�/c��URU5nUbU$URR5Hup4XA:XdMUs $ g)z�Return the inactive file_id associated with a transaction id.
That is, the one in the tree or in non_present_ids.
The file_id may actually be active, too.
N)r�rHr})rNrfrk�key�values     r<�inactive_file_id�"TreeTransformBase.inactive_file_id8sE��
�#�#�H�-�����N��/�/�5�5�7�J�C�� ��
�8rRc�4�URSLa
[5e/nUR5 UR5nUR	URU55 UR	UR
55 UR	URU55 UR	URU55 UR	UR55 UR	UR55 UR	UR55 U$)z:Find any violations of inventory or filesystem invariants.T)�_doner�_add_tree_childrenr��extend�_unversioned_parents�
_parent_loops�_duplicate_entries�_parent_type_conflicts�_improper_versioning�_executability_conflicts�_overwrite_conflicts)rN�	conflictsr�s   r<�find_raw_conflicts�$TreeTransformBase.find_raw_conflictsDs����:�:���"�$�$��	�	
���!��N�N�$�	�����2�2�9�=�>�����+�+�-�.�����0�0��;�<�����4�4�Y�?�@�����2�2�4�5�����6�6�8�9�����2�2�4�5��rRc�T�UR5n[U5S:wa	[US9eg)Nr)r�)r�r~r)rNr�s  r<�_check_malformed�"TreeTransformBase._check_malformedVs,���+�+�-�	��y�>�Q��$�y�9�9�rRc��[UR55nURURVs/sHo R	U5S:XdMUPM sn5 UR
HsnUR
U5nUb4URRU5S:XaURU5 MIMKUR	U5S:XdMbURU5 Mu UHn[URU55 M gs snf)z�Add all the children of all active parents to the known paths.

Active parents are those which gain children, and those which are
removed.  This is a necessary first step in detecting conflicts.
r,N)r�r�r�r��	tree_kindr�r8rU�stored_kind�appendrm)rN�parents�trfr��	parent_ids      r<r��$TreeTransformBase._add_tree_children[s����t�~�~�'�(������.�.�S�.�1�.�.��2C�{�2R�Q�.�S�	
��(�(�H��>�>�(�+�D����:�:�)�)�$�/�;�>��N�N�8�,�?�����)�[�8����x�(�
)�!�I���(�(��3�4�!��
Ts�D�Dc��Uc UR5RU/5nUHnURU5U:XdM g URRUS5nUcg[	XQ5nUR
RUS5nUc/[R"URRU55$[SRXU55e)a2Does a parent already have a name child.

:param name: The searched for name.

:param parent_id: The parent for which the check is made.

:param known_children: The already known children. This should have
    been recently obtained from `self.by_parent.get(parent_id)`
    (or will be if None is passed).
NTFzchild_id is missing: {}, {}, {})r�r�rorur"rsr
�lexistsrU�abspath�AssertionError�format)rNrdr��known_childrenr��parent_path�
child_pathrys        r<�_has_named_child�"TreeTransformBase._has_named_childqs����!�!�^�^�-�1�1�)�R�@�N�#�E����u�%��-��$��)�)�-�-�i��>������k�0�
��&�&�*�*�:�t�<�����?�?�4�:�:�#5�#5�j�#A�B�B� �1�8�8��(�S��
rRc�^^^�TR5RT/5m[R"UUUU4Sj5$)z�Find an available backup name.

:param name: The basename of the file.

:param target_id: The directory trans_id where the backup should
    be placed.
c�*>�TRUTT5$r\)r�)�baser�rN�	target_ids ���r<�<lambda>�:TreeTransformBase._available_backup_name.<locals>.<lambda>�s���t�4�4�T�9�n�UrR)r�r�r
�available_backup_name)rNrdr�r�s` `@r<�_available_backup_name�(TreeTransformBase._available_backup_name�s7������)�-�-�i��<���,�,��U�
�	
rRc#�# �URH\n[5nUnU[:wdMURU5 UR	U5nX1:XaSU4v� X2;aMPU[:waMAM^ g![
a Mnf=f7f)z$No entry should be its own ancestor.zparent loopN)rcr�r�addrpr�)rNrf�seenr�s    r<r��TreeTransformBase._parent_loops�s�����(�(�H��5�D� �I��{�*�����#�� $� 1� 1�)� <�I��(�(�(�3�3��$���{�*�)�� ����s3�$B�B�A0�
B�+B�0
A>�:B�=A>�>Bc#��# �UR5HQup#U[:XaMURU5(aM)UH"nURU5(dMSU4v�  MO MS g7f)z@If parent directories are versioned, children must be versioned.zunversioned parentN)r}rr�)rNr�r��childrenrys     r<r��&TreeTransformBase._unversioned_parents�sa���#,�?�?�#4��I��K�'���&�&�y�1�1��$���*�*�8�4�4�/��;�;��%�$5�s�AA)�A)c#�# �URHnnURU5nUS:Xa!URR5(dM;UcSU4v� MFURR	U5(aMhSX4v� Mp g7f)zmCannot version a file with no contents, or a bad type.

However, existing entries with no contents are okay.
r/Nzversioning no contentszversioning bad kind)rGr�rU�supports_symlinks�versionable_kind)rNrfr0s   r<r��&TreeTransformBase._improper_versioning�ss���
���H��?�?�8�,�D��y� ����)E�)E�)G�)G���|�/��:�:���:�:�.�.�t�4�4�,�h�=�=�%�s�A1B�7Bc#�# �URH>nURU5(dSU4v� M!URU5S:wdM8SU4v� M@ g7f)a
Check for bad executability changes.

Only versioned files may have their executability set, because
1. only versioned entries can have executability under windows
2. only files can be executable.  (The execute bit on a directory
   does not indicate searchability)
zunversioned executabilityr-znon-file executabilityN)r�r�r�r�s  r<r��*TreeTransformBase._executability_conflicts�sO����/�/�H��*�*�8�4�4�2�H�=�=��?�?�8�,��6�3�X�>�>�0�s�AA�Ac#�# �URH=nURU5cMXR;dM(SXRU54v� M? g7f)z.Check for overwrites (not permitted on Win32).N�	overwrite)r�r�r�ror�s  r<r��&TreeTransformBase._overwrite_conflicts�sG����*�*�H��~�~�h�'�/���5�5�5�"�H�o�o�h�.G�H�H�	+�s
�1A�Ac#��# �URUR4004:XagUR5H�n/nUHLnURU5nUcMUR(dUR5nUR
XT45 MN UR5 SnSnUHAupXURU5n	U	cURU5(dM1XV:XaSXxU4v� UnUnMC M� g7f)z5No directory may have two entries with the same name.N�	duplicate)
rbrc�valuesrorM�lowerr��sortr�r�)
rNr�r��name_ids�	child_tidrd�	last_name�
last_trans_idrfr0s
          r<r��$TreeTransformBase._duplicate_entries�s�����N�N�D�,�,�-�"�b��9��!�(�(�*�H��H�%�	����y�1���#��6�6�#�z�z�|���O�O�T�$5�6�
&�
�M�M�O��I� �M�"*������x�0���<��(?�(?��(I�(I���$�&�
��F�F� �	� (�
�#+�+�s
�AC)�BC)c#�# �UR5Heup#U[:XaMSnUHnURU5cMSn O U(aM;URU5nUcSU4v� MWUS:wdM_SU4v� Mg g7f)z&Children must have a directory parent.TNFzmissing parentr,znon-directory parent)r}rr�)rNr�r�r��no_childrenryr0s       r<r��(TreeTransformBase._parent_type_conflicts�s����#,�?�?�#4��I��K�'���K�$���?�?�8�,�8�"'�K��%����?�?�9�-�D��|�'��3�3���$�-�y�9�9�%$5�s�9A=�/A=�2A=c���URR5(a�URUnURRU5n[R
"U5RnU(a\[R"S5n[R"U5 USU)--nUS-(a	USU)--nUS-(a	USU)--nOUS-n[R"XG5 gg)	z)Set the executability of versioned files.r�@�r'� �i����N)
rU�_supports_executabler�r�r5�stat�st_mode�umaskr
�chmod_if_possible)rNr�rf�new_executabilityr��current_moder�to_modes        r<�_set_executability�$TreeTransformBase._set_executabilitys����:�:�*�*�,�,� $� 7� 7�� A���j�j�(�(��.�G��7�7�7�+�3�3�L� ������������&�%�5�&�.�9���%�'��u��v�~�-�G��%�'��u��v�~�-�G��&��/���%�%�g�7�-rRc�L�URX5nUbURXCS9 U$)z1Helper function to create a new filesystem entry.rj)rgrr�rNrdr�rkrfs     r<�
_new_entry�TreeTransformBase._new_entry!s.���#�#�D�4�������h��8��rRc�r�URXU5nURX7US9 UbURXW5 U$)ajConvenience method to create files.

name is the name of the file to create.
parent_id is the transaction id of the parent directory of the file.
contents is an iterator of bytestrings, which will be used to produce
the file.
:param file_id: The inventory ID of the file, if it is to be versioned.
:param executable: Only valid when a file_id has been supplied.
��sha1)r�create_file�set_executability)rNrdr��contentsrk�
executabler rfs        r<�new_file�TreeTransformBase.new_file(sB���?�?�4�G�<��	
����$��7��!��"�"�:�8��rRc�L�URXU5nURU5 U$)z�Convenience method to create directories.

name is the name of the directory to create.
parent_id is the transaction id of the parent directory of the
directory.
file_id is the inventory ID of the directory, if it is to be versioned.
)rrvrs     r<�
new_directory�TreeTransformBase.new_directory<s'���?�?�4�G�<�����h�'��rRc�L�URXU5nURX55 U$)aConvenience method to create symbolic link.

name is the name of the symlink to create.
parent_id is the transaction id of the parent directory of the symlink.
target is a bytestring of the target of the symlink.
file_id is the inventory ID of the file, if it is to be versioned.
)r�create_symlink)rNrdr��targetrkrfs      r<�new_symlink�TreeTransformBase.new_symlinkHs'���?�?�4�G�<�����F�-��rRc�,�[UR5e)aSchedule an item to be orphaned.

When a directory is about to be removed, its children, if they are not
versioned are moved out of the way: they don't have a parent anymore.

:param trans_id: The trans_id of the existing item.
:param parent_id: The parent trans_id of the item.
�r��
new_orphan�rNrfr�s   r<r1�TreeTransformBase.new_orphanTs��"�$�/�/�2�2rRc��/nUR5UH@nX0R;aMURU5(dURU5 M=Sn U$ U$)a�Find the potential orphans in a directory.

A directory can't be safely deleted if there are versioned files in it.
If all the contained files are unversioned then they can be orphaned.

The 'None' return value means that the directory contains at least one
versioned file and should not be deleted.

:param dir_id: The directory trans id.

:return: A list of the orphan trans ids or None if at least one
     versioned file is present.
N)r�r�r�r�)rN�dir_id�orphansrs    r<�_get_potential_orphans�(TreeTransformBase._get_potential_orphans_sc�������)�&�1�I��2�2�2���*�*�9�5�5����y�)������2��rRc�t�[UR5nURUR5 URUR5 URUR
5 URUR5 URUR5 URUR5 U$)z:Return the set of transform ids affected by the transform.)	r�r�r�rGr�r�r�rbrc)rN�	trans_idss  r<�
_affected_ids�TreeTransformBase._affected_ids~s�����(�(�)�	�������&�����/�/�0�����+�+�,�����0�0�1�������(�����)�)�*��rRc��UR5n0n0nUH5nURU5nUbXBU'URU5nUcM1XCU'M7 X#4$)zBReturn mapping of file_ids to trans_ids in the to and from states.)r;r�rl)rNr:�from_trans_ids�to_trans_idsrf�from_file_id�
to_file_ids       r<�_get_file_id_maps�#TreeTransformBase._get_file_id_maps�sm���&�&�(�	�����"�H��,�,�X�6�L��'�/7�|�,��+�+�H�5�J��%�+3�Z�(�
"��+�+rRc��URRU5nU(a?[URR	U/S95SnUR
nURnOKSnUcSnSnOA[RRU5nURU5nURU5nUbURRXC5up�n
OSnSn	XVX�4$)zaGet data about a file in the from (tree) state.

Return a (name, parent, kind, executable) tuple
��specific_filesr'NF)
rur��nextrU�iter_entries_by_dirrdr�r5r��basename�get_tree_parentr��_comparison_data)rN�
from_trans_id�from_versioned�	from_path�
from_entry�	from_name�from_parent�tree_parent�	from_kind�from_executable�
from_statss           r<�_from_file_data�!TreeTransformBase._from_file_data�s���
�'�'�+�+�M�:�	����
�
�.�.�y�k�.�J����J�#���I�$�.�.�K��J�� � �	�"���G�G�,�,�Y�7�	�"�2�2�=�A��"�/�/��<��� �59�Z�Z�5P�5P��6�2�I�
��I�#�O��y�A�ArRc���URU5nURU5nURURU55nXR;aURUnO
X:XaUnOSnXFXW4$)zaGet data about a file in the to (target) state.

Return a (name, parent, kind, executable) tuple
F)ror�rlrpr�)rN�to_trans_idrLrT�to_name�to_kind�	to_parent�
to_executables        r<�
_to_file_data�TreeTransformBase._to_file_data�sr��
�/�/�+�.���/�/�+�.���&�&�t�'8�'8��'E�F�	��1�1�1� �3�3�K�@�M�
�
)�+�M�!�M��7�9�9rRc��[U5nUR5up#/n[U5RU5GH&nSnUR	U5nUcSnX5nOSnUR	U5n	U	cSn
Un	OSn
U(dSnOUR
R	U5nU
(dSnOUR
U	5nURXxU5up�nnURX�U5unnnnUU:waSnOUS;aX�:wdX�R;aSnU(dX�:XaUU:XaU
U:XaUU:XaM�UR[R"UX�4UX�4UU4U
U4UU4UU455 GM) Sn[[UUS95$)akProduce output in the same format as Tree.iter_changes.

Will produce nonsensical results if invoked while inventory/filesystem
conflicts (as reported by TreeTransform.find_raw_conflicts()) are present.

This reads the Transform, but only reproduces changes involving a
file_id.  Files that are not versioned in either of the FROM or TO
states are not reflected.
FNT)r-r/c�b�URS=(d SURS=(d S4$)NrrCr')r�)�cs r<�path_key�0TreeTransformBase.iter_changes.<locals>.path_keys%���F�F�1�I�O��Q�V�V�A�Y�_�"�5�5rR�r�)rrBr��unionr�ru�get_pathrVr^r�r�r)�InventoryTreeChange�iterr�)rN�final_pathsr>r?�resultsrk�modifiedrLrMrY�to_versionedrN�to_pathrPrQrSrTrZr\r[r]rcs                      r<�iter_changes�TreeTransformBase.iter_changes�s���!��&��'+�'=�'=�'?�$�����>�*�0�0��>�G��H�*�.�.�w�7�M��$�!&�� ,� 5�
�!%��&�*�*�7�3�K��"�$��+��#��!� �	� �/�/�3�3�M�B�	����%�.�.�{�;��AE�AU�AU��y�B�>�I�I��:>�9K�9K��O�:�6�G�Y����G�#����/�/��,��?Q�?Q�0Q����"�2��9�,���(�#�}�4���N�N��1�1���(��#�2� �)�,���(���(�$�m�4�	�
�_?�x	6��F�7��1�2�2rRc�,�[UR5e�z�Return a tree representing the result of the transform.

The tree is a snapshot, and altering the TreeTransform will invalidate
it.
)r��get_previewr]s r<�get_preview_tree�"TreeTransformBase.get_preview_trees��"�$�"2�"2�3�3rRc	��UR5 U(ak[UR5R[UR55nUH.nURU5(aM[R"5e UR5up�U[R:XaUb[S5e/nOU/nUbURU5 URR5U:waA[SRURR5R!S555eSSKJn UR&R)X�U5n	UR+UUUUU	U
S9nUR-5n[/UR1UX�R3555 UR55 UR%U5n
UR7U
S-U
5 U
$)a~Commit the result of this TreeTransform to a branch.

:param branch: The branch to commit to.
:param message: The message to attach to the commit.
:param merge_parents: Additional parent revision-ids specified by
    pending merges.
:param strict: If True, abort the commit if there are unversioned
    files.
:param timestamp: if not None, seconds-since-epoch for the time and
    date.  (May be a float.)
:param timezone: Optional timezone for timestamp, as an offset in
    seconds.
:param committer: Optional committer in email-id format.
    (e.g. "J Random Hacker <jrandom@example.com>")
:param authors: Optional list of authors in email-id format.
:param revprops: Optional dictionary of revision properties.
:param revision_id: Optional revision id.  (Specifying a revision-id
    may reduce performance for some non-native formats.)
:return: The revision_id of the revision committed.
z-Cannot supply merge parents for first commit.z+TreeTransform not based on branch basis: {}�utf-8r)�commit)�	timestamp�timezone�	committer�revprops�revision_idr')r�r�r�r�rGr�r�StrictCommitFailed�last_revision_info�
_mod_revision�
NULL_REVISIONrr�rU�get_revision_idr��decoderCrx�Commit�update_revprops�get_commit_builderrtr��record_iter_changesro�finish_inventory�set_last_revision_info)rN�branch�message�
merge_parents�strictryrzr{�authorsr|r}�unversionedrf�revno�last_rev_id�
parent_idsrx�builder�previews                   r<rx�TreeTransformBase.commit"s���B	
������d�0�0�1�<�<�S����=N�O�K�'���.�.�x�8�8� �3�3�5�5�(�$�6�6�8����-�5�5�5��(� �!P�Q�Q��J�%��J��(��!�!�-�0��:�:�%�%�'�;�6��=�D�D��J�J�.�.�0�7�7��@���
�
	��=�=�0�0��7�K���+�+������#�
,�
���'�'�)���W�
(�
(��+�?P�?P�?R�
S�T�� � �"��n�n�W�-���%�%�e�a�i��=��rRc��URU5nUbURRU5S:wagU$![Ra gf=f)Nr-)r8rUr0�_mod_transport�
NoSuchFiler�s   r<�_text_parent�TreeTransformBase._text_parentksW���~�~�h�'��	��|�t�z�z���t�4��>�� ?�����(�(�	��	�s�"9�A�Ac�d�URU5nUcgURRU54$)z/Get texts for compression parents of this file.�)r�rU�
get_file_textr�s   r<�_get_parents_texts�$TreeTransformBase._get_parents_textsts2��� � ��*���<���
�
�(�(��.�0�0rRc�d�URU5nUcgURRU54$)z/Get lines for compression parents of this file.r�)r�rU�get_file_linesr�s   r<�_get_parents_lines�$TreeTransformBase._get_parents_lines{s2��� � ��*���<���
�
�)�)�$�/�1�1rRc
#�d# �SSKnURR5VVs0sH&up4URS5URS5_M( nnnURR5VVs0sH&up4URS5URS5_M( nnnUR
R5VVs0sHup4URS5U_M nnnURR5VVs0sH up4URS5[U5_M" nnnURR5VVs0sH&up4URS5URS5_M( n	nnURR5VVs0sHup4X4RS5_M n
nnURVs/sHo�RS5PM nnURVs/sHo�RS5PM n
nURUUUUU	U
UU
S.	nURURU5S5v� [UR R55GH
up�US:Xa�[#UR%U5S5nUR'5nSSS5 UR)U5n[*R,R/WU5nSR1UR355nUS	:XaSnUS
:Xa7UR5U5n[7U[85(dURS5nURWURS5URS5445v� GM
 gs snnfs snnfs snnfs snnfs snnfs snnfs snfs snf!,(df   GN
=f7f)z^Serialize this TreeTransform.

:param serializer: A Serialiser like pack.ContainerSerializer.
rNrw)	�
_id_number�	_new_name�_new_parent�_new_executability�_new_id�_tree_path_ids�_removed_id�_removed_contents�_non_present_ids))sattribsr-r.rRr,r/�ascii)�fastbencoderbr}�encodercrGr��intrsrHr�r��
_id_number�bytes_record�bencoder�r�r1�_limbo_name�	readlinesr�r	�MultiParent�
from_lines�join�to_patch�_read_symlink_target�
isinstance�bytes)rN�
serializerr�r�r��new_name�
new_parent�new_idr�
tree_path_ids�non_present_idsrf�removed_contents�
removed_id�attribsr0�cur_file�linesr��mpdiff�contents                     r<�	serialize�TreeTransformBase.serialize�s]���
	&�>B�^�^�=Q�=Q�=S�
�=S�T�Q�A�H�H�W��q�x�x��0�0�=S�	�
�>B�=M�=M�=S�=S�=U�
�=U�T�Q�A�H�H�W��q�x�x��0�0�=U�	�
�48�<�<�3E�3E�3G�H�3G�4�1�!�(�(�7�#�Q�&�3G��H�26�2I�2I�2O�2O�2Q�
�2Q�$�!�A�H�H�W��s�1�v�%�2Q�	�
�>B�=P�=P�=V�=V�=X�
�=X�T�Q�A�H�H�W��q�x�x��0�0�=X�	�
�.2�-B�-B�-H�-H�-J�
�-J�T�Q�A�x�x�� � �-J�	�
�6:�5K�5K�
�5K��O�O�G�$�5K�	�
�@D�?O�?O�P�?O�8�o�o�g�.�?O�
�P��?�?�"�&�#4��,�&�"2�!0�

���%�%�g�o�o�g�&>�@P�Q�Q�$�T�%7�%7�%=�%=�%?�@�N�H��v�~��$�*�*�8�4�d�;�x�$�.�.�0�E�<��1�1�(�;��$�0�0�;�;�E�7�K���(�(�6�?�?�#4�5���{�"����y� ��3�3�H�=��!�'�5�1�1�%�n�n�W�5�G��)�)��8�?�?�7�3�T�[�[��5I�J�L��
�A��A
��
��I��
��
��
��
��Q�<�;�s~�"N0�-M0� N0�1-M6� N0�>M<� N0�<'N�# N0�-N�0 N0�N�-N0�>N�N0�(N�BN0�N�DN0�
N-	�(N0c���SSKn[U5up4URU5nUSUlUSR	5VVs0sH&upgURS5URS5_M( snnUlUSR	5VVs0sH&upgURS5URS5_M( snnUlUSR	5VVs0sH upgURS5[U5_M" snnUl	USR	5VVs0sHupgURS5U_M snnUl
URR	5VVs0sHupgXv_M	 snnUl0Ul0Ul
US	R	5HCup�URS5n
U	RS5n	X�RU
'X�RU	'ME US
V	s1sHo�RS5iM sn	UlUSV	s1sHo�RS5iM sn	UlUSR	5VVs0sHupgXgRS5_M snnUlUH�uuup�nU	RS5n	URS
5nUS:XaP["R$R'U5nUR)UR+U	55n
UR-X�5 US:XaUR/U	5 US:XdM�UR1URS5U	5 M� gs snnfs snnfs snnfs snnfs snnfs sn	fs sn	fs snnf)z�Deserialize a stored TreeTransform.

:param records: An iterable of (names, content) tuples, as per
    pack.ContainerPushParser.
rNr�r�rwr�r�r�r�r�r�r�r�r-r,r/)r�rG�bdecoder�r}r�rbrc�boolr�rGrIrsrur�r�rHr	r��
from_patch�to_linesr�r!rvr+)rN�recordsr��namesr�r�r�r��bytepathrfr�r0r�r�s              r<�deserialize�TreeTransformBase.deserialize�s1��	&��g�����/�/�'�*��!�-�0��� ��-�3�3�5�
�5���
�H�H�W��q�x�x��0�0�5�
��� ��/�5�5�7�
�7���
�H�H�W��q�x�x��0�0�7�
��� � 5�6�<�<�>�#
�>���
�H�H�W��t�A�w�&�>�#
���:A��9L�9R�9R�9T�U�9T�������)�1�,�9T�U���+/�<�<�+=�+=�+?�@�+?�4�1�!�$�+?�@��� ��� ���")�*;�"<�"B�"B�"D��H��?�?�7�+�D����w�/�H�(0����%�,0����)�	#E�6=�^�5L�
�5L��O�O�G�$�5L�
���6=�=Q�5R�"
�5R��O�O�G�$�5R�"
���.5�5H�-I�-O�-O�-Q�!
�-Q�T�Q�A�x�x�� � �-Q�!
���-4�(��
�h�����w�/�H��;�;�w�'�D��v�~�$�0�0�;�;�G�D������(?�(?��(I�J��� � ��1��{�"��%�%�h�/��y� ��#�#�G�N�N�7�$;�X�F�-4��=
��
��#
��V��@��
��"
��!
s0�-L;�-M�'M�!M
�%M�+M�M�M#c�,�[UR5e)�Schedule creation of a new file.

:seealso: new_file.

:param contents: an iterator of strings, all of which will be written
    to the target destination.
:param trans_id: TreeTransform handle
:param mode_id: If not None, force the mode of the target file to match
    the mode of the object referenced by mode_id.
    Otherwise, we will try to preserve mode bits of an existing file.
:param sha1: If the sha1 of this content is already known, pass it in.
    We can use it to prevent future sha1 computations.
)r�r!)rNr#rf�mode_idr s     r<r!�TreeTransformBase.create_file�s��"�$�"2�"2�3�3rRc�,�[UR5e)�?Schedule creation of a new directory.

See also new_directory.
)r�rvr�s  r<rv�"TreeTransformBase.create_directory�s��
"�$�"7�"7�8�8rRc�,�[UR5e)�YSchedule creation of a new symbolic link.

target is a bytestring.
See also new_symlink.
)r�r+)rNr,rfs   r<r+� TreeTransformBase.create_symlinks��"�$�"5�"5�6�6rRc�,�[UR5e)�!Schedule creation of a hard link.)r��create_hardlink)rNr�rfs   r<r��!TreeTransformBase.create_hardlink���!�$�"6�"6�7�7rRc�,�[UR5e)�)Cancel the creation of new file contents.)r�r�r�s  r<r��!TreeTransformBase.cancel_creationr�rRc�,�[UR5e)�Apply all changes to the inventory and filesystem.

If filesystem or inventory conflicts are present, MalformedTransform
will be thrown.

If apply succeeds, finalize is not necessary.

:param no_conflicts: if True, the caller guarantees there are no
    conflicts, so no check is made.
:param precomputed_delta: An inventory delta to use instead of
    calculating one.
:param _mover: Supply an alternate FileMover, for testing
)r��apply)rN�no_conflicts�precomputed_delta�_movers    r<r��TreeTransformBase.applys��"�$�*�*�-�-rRc�L�[5n[[X55nUH0nURS:XdMUR	UR
5 M2 UVs/sH'nURS:wdUR
U;dM%UPM) nn[
U[RS9$s snf)z9Generate a list of cooked conflicts, sorted by file path.�contents conflict�
path conflictre)	r�r��iter_cook_conflicts�
typestringr�rkr�r*�sort_key)rN�
raw_conflicts�content_conflict_file_ids�cooked_conflictsrbs     r<�cook_conflicts� TreeTransformBase.cook_conflicts&s���$'�E�!�� 3�M� H�I��!�A��|�|�2�2�)�-�-�a�i�i�8�"�&�
�%���|�|��.��y�y� 9�9�
�%�	�
��&�H�,=�,=�>�>��

s�$B!�B!)rMr�r�rGrbrcrLrHrFrIr�r�rUrurs�NTr\)F)NNN)NFNNNNNN�NN�FNN)=�__name__�
__module__�__qualname__�__firstlineno__�__doc__rErY�_TreeTransformBase__get_root�property�rootrgrzr�r�rrr�r�r�r�rlr�r�r�r�r�r�r�r�r�r�r�r�r�rrr%r(r-r1r7r;rBrVr^rortrxr�r�r�r�r�r!rvr+r�r�r�r��__static_attributes__�
__classcell__�rPs@r<r?r?PsH���7�5�4���J��D��,�B<)�|5�.5�:�;�4(�8�+�
��$:�
5�,�<
�� 
�>� 
?�I�)�2:�,8�&�NR��(
�
�	3��>	�,�  B�D:� M3�^4���������G�R�1�2�6�p3G�j4� 9�7�8�8�.� ?�?rRr?c	�N�UbUcSn	O6URURU55n
[R"X�5n	UbUcSnO7URURU55n
[R"X�5n[
R"X)X�S9$![a Sn
N9f=f)Nz	<deleted>rC)r��
conflict_pathrk)rgr�r
�pathjoinrr*�factory)�tt�fp�
conflict_typerfrk�this_parent�	this_name�other_parent�
other_name�	this_pathr��
other_paths            r<�cook_path_conflictr:s�����i�/��	��k�k�"�"5�"5�k�"B�C���$�$�[�<�	���z�1� �
�	��+�+�b�&9�&9�,�&G�H�K�
�%�%�k�>�
�����Z�����	��K�	�s�
 B�B$�#B$c���UHnURU5nUcM O URW5nSH*nURU5(dMUS[U5*n O [R
"X&WS9$)N)z.BASEz.THISz.OTHER�r�rk)rlrg�endswithr~r*r)r
rrr:rfrkr��suffixs        r<�cook_content_conflictrYsx�����"�"�8�,�����	�
�;�;�x� �D�.���=�=�� � ���3�v�;�,�'�D��	/�
���M�g�F�FrRc�p�URU5nURU5n[R"X$US9$)Nr)rgrlr*r)r
rrrfr�rks      r<�cook_text_conflictrhs3��
�;�;�x� �D����x�(�G����M�g�F�FrR)r�z
text conflictr�c#�# �[U5nUHnUSn[UnU"X/UQ76v� M g![a� USnURUS5nUR	US5n[U5S:Xa[R"XFXxS9v� M�URUS5n	UR	US5n
[R"UUUUU	U
S9v� M�f=f7f)Nrr'r�)�actionr�rk)r r�rkr
�conflict_file_id)r�CONFLICT_COOKERSr�rgrlr~r*r)r�r
r�conflict�c_type�cookerr �
modified_path�modified_id�conflicting_path�conflicting_ids           r<r�r�us����	�B��B�!���!���	,�%�f�-�F�,��+�(�+�+�3"���	��a�[�F��K�K����4�M��*�*�8�A�;�7�K��8�}��!��&�&��
���
$&�;�;�x��{�#;� �!#�!1�!1�(�1�+�!>���&�&��!�&�'�"2�%3�
��	�s3�C�	2�C�AC�C�AC�C�C�Cc�^�\rSrSrSrSSjrSrSrSrSr	U4Sjr
S	rS
rSr
SSjrS
rSrSrSrSrSrSrSrU=r$)�DiskTreeTransformi�z,Tree transform storing its contents on disk.c��[RXX45 X lSUl0Ul[5Ul0Ul0Ul[5Ul	SUl
[R"UR5Ul
g)aUConstructor.
:param tree: The tree that will be transformed, but not necessarily
    the output tree.
:param limbodir: A directory where new files can be stored until
    they are installed in their proper places
:param pb: ignored
:param case_sensitive: If True, the target of the transform is
    case sensitive, not just case preserving.
N)r?rE�	_limbodir�_deletiondir�_limbo_filesr��_possibly_stale_limbo_files�_limbo_children�_limbo_children_namesr��_creation_mtimer
r��_create_symlinks)rNr�limbodirrBrOs     r<rE�DiskTreeTransform.__init__�sn��	�"�"�4�r�B�!�� ������+.�5��(� "���%'��"� �U���#��� '� 9� 9�$�.�.� I��rRc��URcg[URR55nUR	UR
5 UR
SS9 UHn[R"U5 M [R"UR5 URb [R"UR5 ["R%U5 g![a*nUR[R:waeSnAM�SnAff=f![an[UR5UeSnAff=f![a&n[R "UR5UeSnAff=f!["R%U5 f=f)z�Release the working tree lock, if held, clean up limbo dir.

This is required if apply has not been invoked, but can be invoked
even after apply.
NT��reverse)rUr�r/rr�r0rr
�
delete_any�OSError�errno�ENOENTr-rr.r�ImmortalPendingDeletionr?rY)rN�limbo_pathsr��es    r<rY�DiskTreeTransform.finalize�sG���:�:���	-��t�0�0�7�7�9�:�K����t�?�?�@����T��*�#����&�&�t�,�$�
;��"�"�4�>�>�2�
O��$�$�0��&�&�t�'8�'8�9�
�&�&�t�,��#���w�w�%�,�,�.��/�����
;�#�D�N�N�3��:��
;���
O��4�4�T�5F�5F�G�Q�N��
O��
�&�&�t�,�sr�AE4�#C"�9E4�> D�-E�"
D�,D�E4�D�E4�
D>�#D9�9D>�>E4�
E1�!E,�,E1�1E4�4Fc�B�[R"UR5$)z4Check if the limbo path supports the executable bit.)r
�supports_executabler-r]s r<�_limbo_supports_executable�,DiskTreeTransform._limbo_supports_executable�s���*�*�4�>�>�:�:rRc��URRU5nUcURU5nX RU'U$)z"Generate the limbo name of a file.)r/r��_generate_limbo_path)rNrf�
limbo_names   r<r��DiskTreeTransform._limbo_name�sB���&�&�*�*�8�4�
����2�2�8�<�J�*4���h�'��rRc�z�URRU5 [R"URU5$)z�Generate a limbo path using the trans_id as the relative path.

This is suitable as a fallback, and when the transform should not be
sensitive to the path encoding of the limbo directory.
)r�r�r
rr-r�s  r<rG�&DiskTreeTransform._generate_limbo_path�s/��	
�����x�(��������9�9rRc�r>�URRU5nURRU5n[TU]XU5 X0R
;aaX0R;aQURU/5 XB:waURURU5 XB:wdXQ:waURUU	ggggr\)rcr�rbrDrnr/r��_rename_in_limbor1�remover2)rNrdrerf�previous_parent�
previous_namerPs      �r<rn�DiskTreeTransform.adjust_path�s�����*�*�.�.�x�8�����*�*�8�4�
�
���D�(�3��(�(�(�X�=O�=O�-O��!�!�8�*�-��(��$�$�_�5�<�<�X�F��(�M�,A��.�.��?�
�N�-B�	.P�(rRc��UH�nURUnURRU5 URU	X R;aMKUR	U5n[
R"X45 URRU5 URU5H0nURUnXF[U5S-nX`RU'M2 M� g)a�Fix limbo names so that the right final path is produced.

This means we outsmarted ourselves-- we tried to avoid renaming
these files later by creating them with their final names in their
final parents.  But now the previous name or parent is no longer
suitable, so we have to rename them.

Even for trans_ids that have no new contents, we must remove their
entries from _limbo_files, because they are now stale.
N)
r/r0r�r�r�r5�renamerN�_limbo_descendantsr~)rNr:rf�old_path�new_path�
descendant�	desc_paths       r<rM�"DiskTreeTransform._rename_in_limbo�s���"�H��(�(��2�H��,�,�0�0��:��!�!�(�+��1�1�1���'�'��1�H��I�I�h�)��,�,�3�3�H�=�"�5�5�h�?�
� �-�-�j�9�	�$��X���'A�A�	�09�!�!�*�-�@�"rRc��[URRU/55n[U5H#nUR	URU55 M% U$)z@Return the set of trans_ids whose limbo paths descend from this.)r�r1r�r�r�rT)rNrf�descendantsrWs    r<rT�$DiskTreeTransform._limbo_descendantssM���$�.�.�2�2�8�R�@�A���{�+�J����t�6�6�z�B�C�,��rRc�,�[UR5er\)r��	_set_mode�rNrfr��typefuncs    r<r^�DiskTreeTransform._set_modes��!�$�.�.�1�1rRc�b�URU5n[US5n[URUS5 UR	U5 SSS5 URU5 UR
X#[5 Ub&U[R"U54URU'gg!,(df   N_=f)r��wbr-N)r�r1r%r��
writelines�
_set_mtimer^rr
�lstatrF)rNr#rfr�r rd�fs       r<r!�DiskTreeTransform.create_files�������)��
�$��
���t�)�)�8�V�<�
�L�L��"��	
��������x�'�2���.2�G�M�M�$�4G�-H�D� � ��*���
�s�)B � 
B.c�L�[R"URU55$r\)r5r6r�r�s  r<r��&DiskTreeTransform._read_symlink_target/s���{�{�4�+�+�H�5�6�6rRc��URc[R"5Ul[R"XRUR45 g)zdAll files that are created get the same mtime.

This time is set by the first object to be created.
N)r3�timer5�utime�rNr�s  r<re�DiskTreeTransform._set_mtime2s;��
���'�#'�9�9�;�D� �
����,�,�d�.B�.B�C�DrRc�^�URU5n[R"X5 [URUS5 g![a;nUR[R
:wae[R"U5UeSnAff=f![a [R"U5 ef=f)r�Nr-)r�r5�linkr;r<�EPERMr�HardLinkNotSupportedr%r��
BaseException�unlink)rNr�rfrdr@s     r<r��!DiskTreeTransform.create_hardlink;s�������)��	;��G�G�D��
	��t�)�)�8�V�<���	;��w�w�%�+�+�%���-�-�d�3��:��	;���	�
�I�I�d�O��		�s"�A�B
�
B�6B�B�
"B,c�|�[R"URU55 [URUS5 g)r�r,N)r5�mkdirr�r%r�r�s  r<rv�"DiskTreeTransform.create_directoryLs-��
	����!�!�(�+�,��4�%�%�x��=rRc�D�UR(a&[R"XRU55 O@[	U5RU5n[R"SRU55 [URUS5 g![a SnNKf=f)r�Nz1Unable to create symlink "{}" on this filesystem.r/)r4r5r/r�rrgr�r�warningr�r%r�)rNr,rfr�s    r<r+� DiskTreeTransform.create_symlinkTs���� � ��J�J�v�/�/��9�:�
�!�$�'�0�0��:��
�M�M�C�J�J�4�P�
�	�4�%�%�x��;���
���
�s�B�B�Bc�2�URU	XR;a
URU	URRU5nUb+UR	U5 URU	UR
U	[R"URU55 g)r�N)	r�rFr1r�rMr2r
r:r�)rNrfr�s   r<r��!DiskTreeTransform.cancel_creationis������x�(��+�+�+��$�$�X�.��'�'�+�+�H�5�����!�!�(�+��$�$�X�.��*�*�8�4����4�+�+�H�5�6rRc�l�URR5nURS5nU"XU5 g)Nztransform.orphan_policy)rU�get_config_stackr�)rNrfr��conf�
handle_orphans     r<r1�DiskTreeTransform.new_orphanws-���z�z�*�*�,�����!:�;�
��d�i�0rR)	r4r3r.r1r2r/r-r�r0r�r�)r�r�rrrrErYrDr�rGrnrMrTr^r!r�rer�rvr+r�r1rrrs@r<r+r+�se���6�J�4 -�D;��:�	O�:�2�2�I�47�E��">�<�*7�1�1rRr+c�^�\rSrSrSrSSjrSrSrSrSr	Sr
SS	jrS
rSr
U4SjrSS
jrSrSrSrSrSrSrSrU=r$)�InventoryTreeTransformi}a�	Represent a tree transformation.

This object is designed to support incremental generation of the transform,
in any order.

However, it gives optimum performance when parent directories are created
before their contents.  The transform is then able to put child files
directly in their parent directory, avoiding later renames.

It is easy to produce malformed transforms, but they are generally
harmless.  Attempting to apply a malformed transform will cause an
exception to be raised before any modifications are made to the tree.

Many kinds of malformed transforms can be corrected with the
resolve_conflicts function.  The remaining ones indicate programming error,
such as trying to create a file with no path.

Two sets of file creation methods are supplied.  Convenience methods are:
 * new_file
 * new_directory
 * new_symlink

These are composed of the low-level methods:
 * create_path
 * create_file or create_directory or create_symlink
 * version_file
 * set_executability

Transform/Transaction ids
-------------------------
trans_ids are temporary ids assigned to all files involved in a transform.
It's possible, even common, that not all files in the Tree have trans_ids.

trans_ids are used because filenames and file_ids are not good enough
identifiers; filenames change, and not all files have file_ids.  File-ids
are also associated with trans-ids, so that moving a file moves its
file-id.

trans_ids are only valid for the TreeTransform that generated them.

Limbo
-----
Limbo is a temporary directory use to hold new versions of files.
Files are added to limbo by create_file, create_directory, create_symlink,
and their convenience variants (new_*).  Files may be removed from limbo
using cancel_creation.  Files are renamed from limbo into their final
location as part of TreeTransform.apply

Limbo must be cleaned up, by either calling TreeTransform.apply or
calling TreeTransform.finalize.

Files are placed into limbo inside their parent directories, where
possible.  This reduces subsequent renames, and makes operations involving
lots of files faster.  This optimization is only possible if the parent
directory is created *before* creating any of its children, so avoid
creating children before parents, where possible.

Pending-deletion
----------------
This temporary directory is used by _FileMover for storing files that are
about to be deleted.  In case of rollback, the files will be restored.
FileMover does not delete files until it is sure that a rollback will not
happen.
c�"�UR"5 [R"URR	S55n[
R"U[R5 [R"URR	S55n[
R"U[R5 0Ul0Ul
[RXX2UR 5 X@lg![a UR"5 ef=f)z�Note: a tree_write lock is taken on the tree.

Use TreeTransform.finalize() to release the lock (can be omitted if
TreeTransform.apply() called).
�limbozpending-deletionN)�lock_tree_writer�local_path_from_url�
_transportr�r
�ensure_empty_directory_existsr�
ExistingLimbo�ExistingPendingDeletionrtrW�
_realpaths�	_relpathsr+rErOr.)rNrrBr5�deletiondirs     r<rE�InventoryTreeTransform.__init__�s���	
����	��3�3�D�O�O�4K�4K�G�4T�U�H��1�1�(�F�<P�<P�Q�"�6�6����'�'�(:�;��K�
�1�1��V�;�;�
��������"�"�4�x�T�=P�=P�Q�'����	��K�K�M��	�s�B(C1�1Dc�8�URRU5$)z%Get the canonical tree-relative path.)rU�get_canonical_pathrns  r<�canonical_path�%InventoryTreeTransform.canonical_path�s���z�z�,�,�T�2�2rRc���URRU5nUcg[R"URRU55$![Ra gf=f)ziDetermine the file kind in the working tree.

:returns: The file kind or None if the file does not exist
N)rur�r
�	file_kindrUr�r�r�r�s   r<r�� InventoryTreeTransform.tree_kind�s_��
�"�"�&�&�x�0���<��	��$�$�T�Z�Z�%7�%7��%=�>�>���(�(�	��	�s�.A�A'�&A'c��UcUnURUn[R"URRU55RnU"U5(a'[R"URU5U5 gg![a gf=f![a9nUR[R[R4;aSnAgeSnAff=f�z�Set the mode of new file contents.
The mode_id is the existing file to get the mode from (often the same
as trans_id).  The operation is only performed if there's a mode match
according to typefunc.
N)rur�r5rrUr�rr;r<r=�ENOTDIRr
rr�)rNrfr�r`rU�moder@s       r<r^� InventoryTreeTransform._set_mode�s����?��G�	��*�*�7�3�H�
	��7�7�4�:�:�-�-�h�7�8�@�@�D��D�>�>��%�%�d�&6�&6�x�&@�$�G����	��	���	��w�w�5�<�<����7�7�
���	�s.�B�9B�
B�B�
C�.C�C�Cc#�j# �URUn[R"URRU55nUHCn[X$5nURRU5(aM0URU5v� ME g![a gf=f![[4a gf=f7f)�2Iterate through the entry's tree children, if any.N)rur�r5�listdirrUr��NotADirectoryError�FileNotFoundErrorr"�is_control_filenamerK)rNr�r�r�r��	childpaths      r<rm�)InventoryTreeTransform.iter_tree_childrens����	��&�&�y�1�D�	��z�z�$�*�*�"4�"4�T�":�;�H��E� ��-�I��z�z�-�-�i�8�8���)�)�)�4�4�	���	��	��#�$5�6�	��	�sF�B3�B
�/B�A
B3�
B�B3�B�B3�B0�-B3�/B0�0B3c��URRU5nSnURRU5S:Xa�URRU5nUb�X R;a)[5URU'0URU'SnO�UR(a'URURU5US4;aSnOSURUR5H0upVXa:XaMUR5UR5:XdM0 O SnU(d[RX5$[R"URUW5nURURU5 XRUU'U$)a@Generate a limbo path using the final path if possible.

This optimizes the performance of applying the tree transform by
avoiding renames.  These renames can be avoided only when the parent
directory is already scheduled for creation.

If the final path cannot be used, falls back to using the trans_id as
the relpath.
Fr,NT)rcr�r�rbr1r�r2rMr}rr+rGr
rr/r�)rNrfre�use_direct_path�filename�
l_filename�
l_trans_idrHs        r<rG�+InventoryTreeTransform._generate_limbo_paths{���!�!�%�%�h�/�� �����!�!�&�)�[�8��~�~�)�)�(�3�H��#��!5�!5�5�36�5�D�(�(��0�9;�D�.�.�v�6�&*�O��0�0��1�1�&�9�=�=�h�G� ��L��+/���26�2L�2L��3��e�g�3�.�
�&�1�$�%�+�+�-����1A�A�!�
3�+/���$�9�9�$�I�I��%�%�d�&7�&7��&?��J�
����V�$�(�(��2�7?�"�"�6�*�8�4��rRc�v�Uc
[5e[URX5 [URX!5 g)r�N)rr%rGrIr�s   r<rr�#InventoryTreeTransform.version_fileHs+���?��,���4�<�<��3��4�>�>�7�5rRc�V�URUnURU	URU	g)r�N)rGrIr�s   r<r��(InventoryTreeTransform.cancel_versioningOs(���,�,�x�(���L�L��"��N�N�7�#rRc���/nURR5nURVs1sHo0RU5iM nnUR
U5nURR5HKup6Xe;dMURRU5nURU5nURSX�45 MM U$![Ra /s$f=fs snf)z(Each inventory id may only be used once.zduplicate id)rU�all_file_idsr�UnsupportedOperationr�r�r�rGr}r�rKr�)	rNr��all_idsrf�removed_tree_ids�active_tree_idsrkr��old_trans_ids	         r<�_duplicate_ids�%InventoryTreeTransform._duplicate_idsUs����	�	��j�j�-�-�/�G�
9=�8H�8H�
�8H�H���h�'�8H�	�
�"�,�,�-=�>��!%���!3�!3�!5��H��)��z�z�)�)�'�2��#�6�6�t�<��� � �.�,�!I�J�	"6�
����*�*�	��I�	��
s�C�C �C�Cc�b>�[TU]5nURUR55 U$r\)rDr�r�r�)rNr�rPs  �r<r��)InventoryTreeTransform.find_raw_conflictshs-����G�.�0�	�����,�,�.�/��rRc���[RSHnU"URU5 M U(dUR5 SUl[
RR5nUc/UR[S5SS5 UR5nSnOUnSnUc[5nOUnUR[S5SU-SU-5 URU5 UR[S5SU-SU-5 URU5n	UR5 SSS5 UR#UR$5cWV
s/sHo�SS:wdM
U
PM nn
URR'W5 UR)5 SUlUR-5 [/W	UR5$![a UR!5 ef=f!,(df   N�=fs sn
f)	r��
pre_transformrNzApply phaserr'rCT)rrVrUr��rename_countr
�
ui_factory�nested_progress_barr�r�_generate_inventory_deltar�_apply_removals�_apply_insertions�apply_deletionsrt�rollbackrlr�apply_inventory_delta�_apply_observed_sha1sr�rYr!)rNr�r�r�rX�child_pb�inventory_delta�offset�mover�modified_pathsr@s           r<r��InventoryTreeTransform.applyms��� �%�%�o�6�D�����T�"�7���!�!�#����
�]�]�
.�
.�
0�H� �(�����
� 6��1�=�"&�"@�"@�"B����"3�����~�"�����	
(�����
� 6��F�
�A��J�O��$�$�U�+�����
� 6��F�
�A��J�O�!%�!7�!7��!>��
�%�%�'�+1�,���d�i�i�(�0�*9�H�/�Q�q�T�R�Z�q�/�O�H��
�
�(�(��9��"�"�$���
��
�
�� ���1B�1B�C�C��!�
���� ��
��#1�
0��.Is2�*AG �2A&G�G �G1�!G1�G�G � 
G.c	�*�[URR5SS9n[RR5n[
U5H�unupVUS:XaMUR[S5U[U55 URRU5nX`R;a=[RRUR U5nUR#Xx5 M�X`R$;dX`R&;dM�UR)XpR+U55 U=R,S-
slM� SSS5 g![.a+n	U	R0[0R2:waeSn	A	GM/Sn	A	ff=f!,(df   g=f)aPerform tree operations that remove directory/inventory names.

That is, delete files that are to be deleted, and put any files that
need renaming into limbo.  This must be done in strict child-to-parent
order.

If inventory_delta is None, no inventory delta generation is performed.
Tr8rC�
removing filer'N)r�rsr}r
r�r��	enumerater�rr~rUr�r�r5r�r�r.�
pre_deleterbrcrSr�r�rr<r=)
rNr��
tree_pathsr��numr�rf�	full_path�delete_pathr@s
          r<r��&InventoryTreeTransform._apply_removals�s2���D�/�/�5�5�7��F�
�
�]�]�
.�
.�
0�H�)2�:�)>�%��%�d��2�:������� 8�#�s�:��O� �J�J�.�.�t�4�	��5�5�5�"$�'�'�,�,�t�/@�/@�(�"K�K��$�$�Y�<����/�8�?O�?O�3O�/����Y�0@�0@��0J�K�
�)�)�Q�.�)�!*?�1�
0��1�"��7�7�e�l�l�2�!�3��"��1�
0�s7�CF�
 E�*F�
F�E<�5F�<F�F�
Fc	�8�URSS9n/n[RR5n[	U5GHFunupgUS-S:Xa%UR[
S5U[U55 URRU5nXpR;a7URURU5U5 U=RS-
sl
XpR";dUR%U5(a XpR";aUR'U5 XpR(;aUR+Xg5 XpR,;dGMUR,Uup�[.R0"U5nX�4UR,U'GMI SSS5 UH#up�XpR2;dMUR2U	M% UR"R55 U$![a*n	U	R[R :waeSn	A	GN/Sn	A	ff=f!,(df   N�=f)aHPerform tree operations that insert directory/inventory names.

That is, create any files that need to be created, and restore from
limbo any files that needed renaming.  This must be done in strict
parent-to-child order.

If inventory_delta is None, no inventory delta is calculated, and
no list of modified paths is returned.
T)r��
r�adding filer'N)r�r
r�r�r�r�rr~rUr�r�rSr�r�rr<r=r��path_changedr�r�rrFr
rfr/�clear)rNr�r�r�r�r�r�rfr�r@�o_sha1�o_st_val�st�_paths              r<r��(InventoryTreeTransform._apply_insertions�s����N�N�4�N�8�	���
�]�]�
.�
.�
0�H�)2�9�)=�%��%�d��"�H��?��O�O�G�M�$:�C��Y��P� �J�J�.�.�t�4�	��1�1�1�/����T�%5�%5�h�%?��K��)�)�Q�.�)��1�1�1�T�5F�5F�x�5P�5P��#5�#5�5�&�-�-�i�8��6�6�6��+�+�D�;��3�3�3�'+�';�';�H�'E�$�F� ���y�1�B�6<�\�D�(�(��2�1*>�1�4 )�O�E��,�,�,��%�%�h�/�	 )�
	
��� � �"����11�"��7�7�e�l�l�2�!�3��"��1�
0�s=�A-H�!G�?BH�<H�
H�H�=H�H�H�
Hc��[U5nURR5H1up#URU5nURRXC5 M3 g)aAfter we have finished renaming everything, update observed sha1s.

This has to be done after self._tree.apply_inventory_delta, otherwise
it doesn't know anything about the files we are updating. Also, we want
to do this as late as possible, so that most entries end up cached.
N)rrFr}rgrU�_observed_sha1)rN�pathsrf�observedr�s     r<r��,InventoryTreeTransform._apply_observed_sha1s�sJ���4� ��"&�"6�"6�"<�"<�">��H��>�>�(�+�D��J�J�%�%�d�5�#?rRc��[U5$rr)�InventoryPreviewTreer]s r<rt�'InventoryTreeTransform.get_preview_tree�s��$�D�)�)rRc�n^�[5nTRVs1sH)nTRUTRU5:wdM'UiM+ nnTRTRUTR
4HnUR
U5 M [TR5nURTR5 URU5 U4SjU5nUR
U5 UH#nUR
TRU55 M% [[T5RU55$s snf)aDetermine which trans_ids need new Inventory entries.

An new entry is needed when anything that would be reflected by an
inventory entry changes, including file name, file_id, parent file_id,
file kind, and the execute bit.

Some care is taken to return entries with real changes, not cases
where the value is deleted and then restored to its original value,
but some actually unchanged values may be returned.

:returns: A list of (path, trans_id) for all items requiring an
    inventory change. Ordered by path.
c3�t># �UH-nTRU5TRU5:wdM)Uv� M/ g7fr\)r�r���.0r�rNs  �r<�	<genexpr>�<InventoryTreeTransform._inventory_altered.<locals>.<genexpr>&s/����
�#�!�t�~�~�a�'8�D�O�O�A�<N�'N�A�A�|�s�(8�	8)r�rGr�rbrcr�r�r��intersection_updater�r�rmr�rr�)rN�changed_idsr��new_file_idr��changed_kind�parent_trans_ids`      r<�_inventory_altered�)InventoryTreeTransform._inventory_altereds����e���|�|�
�#�!�t�|�|�A��$�:K�:K�A�:N�'N�A�|�	�
�
�N�N������#�#�	
�F�
���v�&�

��4�1�1�2���(�(��);�);�<��&�&�{�3�
�#�
��	���<�(� +�O����t�6�6��G�H� +��j��&�0�0��=�>�>��7
s�&D2�D2c
�f�/nUR5n[U5[UR5-n[RR5n[
UR5H�upVUS-S:XaUR[S5XS5 X`R:XaURRS5nOURU5nXpR;aMvURUnURUSUS45 M� UV	V
s0sHup�X�R!U
5_M nn	n
[
U5GH�unup�US-S:Xa2UR[S5U[UR5-U5 X�nUcMMUR#U5nUc4URR%URR'U55nUR)U5n
UR+U
5nUcUR!U
5nX`R,;aQ[.R0"UUR2UUR!UR4U5SUR,U5nO&[.R6"X�R9U5X�5nURR'UR:5nUR@R+U5nUbUUl!URUX�R:U45 GM� SSS5 U$s sn
n	f![<R>a SnNpf=f!,(df   U$=f)z6Generate an inventory delta for the current transform.r�rr�rCNr�)"r�r~r�r
r�r�r�r�rrLrUr�r�rIrur�rlr�r�r�rpr��_new_reference_revisionr(�
TreeReferencerbrc�
make_entryrorkrr�r�r$)rNr�r��
total_entriesr�r�rfrkr��pr��new_path_file_idsr0r��parent_file_id�	new_entryrUrs                  r<r��0InventoryTreeTransform._generate_inventory_delta2s������+�+�-�	��I���T�-=�-=�)>�>�
�
�]�]�
.�
.�
0�H�!*�4�+;�+;�!<�
���"�H��?��O�O�G�O�$<�c�Q��~�~�-�"�j�j�0�0��4�G�"�/�/��9�G��n�n�,���*�*�8�4���&�&��d�G�T�'B�C�"=�GP� P�i�d�a��$6�$6�q�$9�!9�i�� P�)2�9�)=�%��%�d��"�H��?��O�O��
�.��c�$�"2�"2�3�3�%��
,�5���?�����x�0���<��:�:�1�1�$�*�*�2D�2D�W�2M�N�D�"&�"3�"3�H�"=��!2�!6�!6��!G��!�)�%)�%7�%7��%H�N��;�;�;� )� 7� 7�����x�0��*�*�4�+;�+;�H�+E�F���4�4�X�>�!�I�!*� 4� 4��o�o�h�7��!�I�$�#�z�z�1�1�)�2C�2C�D�H�%)�$;�$;�$?�$?��$I�!�$�0�+<�I�(��&�&��$�8I�8I�9�'U�V�I*>�1�f���M!Q��@���$�#�H�$��[1�
0�f��sE�B9L!�K?�(EL!�%L�-AL!�?L!�L�L!�L�L!�!
L0)r.r�r�r�r�r\r�)r�r�rrrrEr�r�r^rmrGrrr�r�r�r�r�r�r�rtr�r�rrrs@r<r�r�}si���?�B(�63��H�45�"0�d6�$��&�
/D�b/�:,�\6�(*�+?�Z8�8rRr�c�@�\rSrSrSrSSjrSrSrSrSr	S	r
S
rg)�TransformPreviewimz�A TreeTransform for generating preview trees.

Unlike TreeTransform, this version works when the input tree is a
RevisionTree, rather than a WorkingTree.  As a result, it tends to ignore
unversioned files in the input tree.
Nc�|�UR"5 [R"SS9n[R	XXBU5 g)Nz
bzr-limbo-)�prefix)�	lock_read�tempfile�mkdtempr+rE)rNrrBrOr5s     r<rE�TransformPreview.__init__us.�������#�#�<�8���"�"�4�x�^�LrRc��U$r\r�rns  r<r��TransformPreview.canonical_pathzs���rRc��URRU5nUcgURRU5SnUS:XaSnU$)Nr�missing)rur�rU�path_content_summary)rNrfr�r0s    r<r��TransformPreview.tree_kind}sK���"�"�&�&�x�0���<���z�z�.�.�t�4�Q�7���9���D��rRc��gr�r�r_s    r<r^�TransformPreview._set_mode�s��	
rRc#�"# �URUn[URR	U/S95Sn[
US05nUH!n[X%5nURU5v� M# g![a gf=f![
a gf=f7f)r�NrEr'r�)	rur�rGrUrH�
StopIteration�getattrr"rK)rNr�r�r7r�r�r�s       r<rm�#TransformPreview.iter_tree_children�s����	��&�&�y�1�D�	�����7�7��v�7�N�O�PQ�R�E��5�*�b�1���E� ��-�I��)�)�)�4�4����	��	���	��	�sD�B�A/�&A?�5B�/
A<�9B�;A<�<B�?
B�	B�B�Bc�,�[UR5er\r0r2s   r<r1�TransformPreview.new_orphan�s��!�$�/�/�2�2rRr�r�)r�r�rrrrEr�r�r^rmr1rr�rRr<rrms&���M�
��
�
5�3rRrc��\rSrSrSrSrSrSrSrSr	Sr
S	rS
r\
S5rSrS
rSrS SjrSrS!SjrSrSrS"SjrSrS#SjrSrSrS$Sjr\R<4SjrS%Sjr Sr!Sr"Sr#g)&r�i�z:Partial implementation of Tree to support show_diff_trees.c���[R"X5 [U5UlURR5Vs0sHo"RU_M snUlgs snfr\)rrEr�_final_paths�
_transformrork�_iter_changes_cache)rN�	transformrbs   r<rE�InventoryPreviewTree.__init__�sR�����T�-�&�y�1���"&�/�/�">�">�"@�$
�"@�Q�I�I�q�L�"@�$
�� ��$
s�A"c��gr�r�r]s r<�supports_setting_file_ids�.InventoryPreviewTree.supports_setting_file_ids�s��rRc�.�URR$r\)rr4r]s r<r��&InventoryPreviewTree.supports_symlinks�s�����/�/�/rRc��g�NFr�r]s r<�supports_tree_reference�,InventoryPreviewTree.supports_tree_reference�s��rRc�f�URRU5nUSL=(a UR$)z0Return True if the content of this file changed.N)rr��changed_content)rNrk�changess   r<�_content_change�$InventoryPreviewTree._content_change�s.���*�*�.�.�w�7���d�"�>�w�'>�'>�>rRc	�^�UR5Vs/sH$nX%RURU554PM& nnURX$4X`R	U55 UR5nURnX�R;aURRU5 U$s snfr\)	�_iter_parent_trees�get_file_revisionr��	add_linesr��_get_repository�texts�fallback_versionedfilesr�)	rNr�rk�vf�
tree_revisionr��parent_keys�repo�base_vfs	         r<�_get_file_revision�'InventoryPreviewTree._get_file_revision�s����,�,�.�
�.���)�)�!�)�)�G�*<�=�>�.�	�
�	���g�-�{�<O�<O�PT�<U�V��#�#�%���*�*���4�4�4��&�&�-�-�g�6����
s�+B*c�d�URRU5n[R"U5$r\)rr�r5rf)rNrfrds   r<�_stat_limbo_file�%InventoryPreviewTree._stat_limbo_file�s$�����*�*�8�4���x�x��~�rRc��URU5up4pVUS:XaSnSnO;URRURU55 UR	U5nX5S4$)Nr
F)rrrl�_path2trans_id�
is_executable)rNr7r�r0�sizer$�link_or_sha1s       r<rK�%InventoryPreviewTree._comparison_data�sa��/3�/H�/H��/N�,��J��9���D��J��O�O�)�)�$�*=�*=�d�*C�D��+�+�D�1�J���%�%rRc�4�[[R5e)z5This Tree does not use inventory as its backing data.)r�r�root_inventoryr]s r<rB�#InventoryPreviewTree.root_inventory�s��"�+�"<�"<�=�=rRc�&^�[TRRR55nUR	U4SjTRR
55 UR
TRRR55 U$)Nc3�Z># �UH nTRRU5v� M" g7fr\)rr�r�s  �r<r��4InventoryPreviewTree.all_file_ids.<locals>.<genexpr>�s'����#
�5P��D�O�O�(�(��+�+�5P���(+)	r�rrUr�r�r�r�rGr)rN�tree_idss` r<r��!InventoryPreviewTree.all_file_ids�sk����t���,�,�9�9�;�<���"�"�#
�59�_�_�5P�5P�#
�	
�	������/�/�6�6�8�9��rRc�^�[TRRR55nUR	U4SjTRR
55 UR
U4SjTRR55 U$)Nc3�Z># �UH nTRRU5v� M" g7fr\)rrKr�s  �r<r��;InventoryPreviewTree.all_versioned_paths.<locals>.<genexpr>�s'����%
�;V�a�D�O�O�.�.�q�1�1�;V�rGc3�Z># �UH nTRRU5v� M" g7fr\)r�_determine_pathr�s  �r<r�rL�s)����
�:Q�Q�D���-�-�a�0�0�:Q�rG)r�rrU�all_versioned_pathsr�r�r�rG)rNr�s` r<rO�(InventoryPreviewTree.all_versioned_paths�st�������.�.�B�B�D�E�
��$�$�%
�;?�?�?�;V�;V�%
�	
�	���
�:>�/�/�:Q�:Q�
�	
��rRc��[U[5(aU/:XaS/n[R"U6nURRUR
U55$)NrC)r�r�r
rrrlr<rns  r<r��InventoryPreviewTree.path2id�sM���d�D�!�!��r�z��t���#�#�T�*�D����,�,�T�-@�-@��-F�G�GrRc���URRU5nURRU5$![an[
R"X5UeSnAff=fr\)rr�rrNrrr�)rNrk�recurserfr@s     r<r��InventoryPreviewTree.id2path�sS���?�?�3�3�G�<��	8��$�$�4�4�X�>�>���	8��/�/�$�0�a�7��	8�s�8�
A�A�Ac#��# �URRR5Vs1sHnURRU5iM  nnUR	URR
5 UR	URR5 UH>nURRU5bM!URRU5v� M@ gs snf7fr\)
rrU�extrasrKr�r�r�rlrrN)rNr��possible_extrasrfs    r<rW�InventoryPreviewTree.extras�s�����_�_�*�*�1�1�3�
�3��
�O�O�.�.�q�1�3�	�
�	���t���<�<�=����t���:�:�;�'�H����,�,�X�6�>��'�'�7�7��A�A�(��

�s�'C$�%C�A+C$�='C$Nc#��# �UH�up4URRU5nUcM%Ub!URRU5U;aMIURR	U5nUcHURR
R
URR
RU55n[R"X`RRU5XE5nXs4v� M� g7fr\)rrlrrgr�rUr�r�r(r�ro)rN�ordered_entriesrFrfr�rkr0r�s        r<�_make_inv_entries�&InventoryPreviewTree._make_inv_entries	s����(7�$�H��o�o�3�3�H�=�G�����*��%�%�.�.�x�8��N���?�?�-�-�h�7�D��|����,�,�8�8��O�O�)�)�1�1�'�:���"�,�,��o�o�0�0��:�N��I��%�%�#)8�s�C,C.c���[/n/n[U5S:�a�UR5nURR	U5n[UR
U55n[[XPRRU555nURURS9 UR[U55 UHnURXt45 M [U5S:�aM�U$)Nrre)rr~rtrrlr��
_all_children�dict�ziprr�rr�r��reversedr�)rN�todo�ordered_idsrer�r�r�rfs        r<�_list_files_by_dir�'InventoryPreviewTree._list_files_by_dirs����}�����$�i�!�m��X�X�Z�F�!�_�_�:�:�6�B�N��D�.�.�v�6�7�H���X�'8�'8�'B�'B�8�'L�M�N�E��M�M�e�i�i�M�(��K�K���*�+�$���"�"�H�#=�>�%��$�i�!�m��rRc#��# �URU5nUc[R"U5eURU5Vs/sHnX24PM nnUR	U5H	upVUv� M gs snf7fr\)r<r�r�r_r\)rNr�rf�child_trans_idrcr7�	_trans_ids       r<�iter_child_entries�'InventoryPreviewTree.iter_child_entries+s�����&�&�t�,���� �+�+�D�1�1�#'�"4�"4�X�">�
�">���&�">�	
�
�!%� 6� 6�t� <��E��K�!=��	
�s�>A3�
A.�
&A3c#��# �U(a[S5eUR5nURX15H$upEURR	U5U4v� M& g7f)N�(follow tree references not yet supported)r�rer\rrg)rNrF�recurse_nestedrdr7rfs      r<rH�(InventoryPreviewTree.iter_entries_by_dir6sX����%�&P�Q�Q��-�-�/��#�5�5�k�R�O�E��#�#�,�,�X�6��=�=� S�s�AAc�f�/nURU5nURRU5nURU5HnUR	XT45 M /nURU5H1upxUR	URRU5U45 M3 UR5 U$)zCReturn path, entry for items in a directory without recursing down.)	r<rrlr_r�r\rrgr)	rN�dir_pathrd�dir_trans_idr5rh�path_entriesr7rfs	         r<�_iter_entries_for_dir�*InventoryPreviewTree._iter_entries_for_dirCs������*�*�8�4�����.�.�|�<��"�0�0��>�N�����7�8�?���#�5�5�k�B�O�E�����!2�!2�!;�!;�H�!E�u� M�N� C������rRc#�8# �U(a[S5eUS:XaSnU(a�SnU(aUS-nUR5nUH]upxURS:Xa	U(dMU(a&URU5(dM=U[	U5SnUSUR
U4v� M_ gUc9USLa4[R"SS[URS55n	SSSU	4v� URU=(d S5nUHupxUSUR
U4v� M g7f)	zSee WorkingTree.list_files.rm�.N�/rC�VTr,)r�rHrd�
startswithr~r0r(r�rr�rt)
rN�include_root�from_dir�	recursivernr�entriesr�r7�
root_entrys
          r<�
list_files�InventoryPreviewTree.list_filesPs����%�&P�Q�Q��s�?��H���F��!�C����.�.�0�G�&����:�:��#�L����?�?�6�2�2� ���F��
�.�D��C����U�2�2� '���L�D�$8�&�1�1���[�$�,�,�r�2B��
��#�{�J�6�6��0�0���R�@�G�&����C����U�2�2� '�s�DDc�j�URU5nUc[R"U5eURU5(dHURR
R
URR
RU55$URU5nURU5R$)zSee Tree.get_file_mtime.)r�r�r�r(rrU�get_file_mtimer�r<r9�st_mtime)rNr�rkrfs    r<r��#InventoryPreviewTree.get_file_mtimers����,�,�t�$���?� �+�+�D�1�1��#�#�G�,�,��?�?�(�(�7�7����%�%�-�-�g�6��
��&�&�t�,���$�$�X�.�7�7�7rRc���URU5nURnURRU5nURRU5nUc4UbX#R
;agURRU5nUupWp�O�Sn	URU5n
X#R;aSnURn	US:XaN[R"U
5nURnUR5(dSnOUR[-nOSnSnUS:XaA[R "U
5n	[#U	[$5(d[R&"U	5n	UR(RX(5nXWX�4$)N)r
NNNztree-referencer-Fr/)r<rrur�r�r�rUrr�r�r5rf�st_sizerDrrr6r��str�fsdecoder�)rNr�rfr
r8r0�summaryr>r$r?rH�statvals            r<r�)InventoryPreviewTree.path_content_summary~sK���&�&�t�,��
�_�_���%�%�)�)�(�3�	����#�#�H�-���<�� �H�0D�0D�$D�2��h�h�3�3�I�>�G�3:�0�D�
�L��L�����1�J��5�5�5�'��!�9�9���v�~��(�(�:�.�������4�4�6�6�!&�J�!(���7�!:�J���!�
��y� �!�{�{�:�6��!�,��4�4�#%�;�;�|�#<�L��*�*�.�.�x�D�
��:�3�3rRc	��XRRLdU(dU(dU(a1[RR	X5RUUUUUUS9$U(a[
S5eURR5$)z�See InterTree.iter_changes.

This has a fast path that is only used when the from_tree matches
the transform tree, and no fancy options are supplied.
)�include_unchangedrFrB�extra_trees�require_versioned�want_unversionedz!want_unversioned is not supported)rrUr�	InterTreer�ror)rN�	from_treer�rFrBr�r�r�s        r<ro�!InventoryPreviewTree.iter_changes�s{�� 
�_�_�2�2�2� ����>�>�%�%�i�6�C�C�"3�-��'�"3�!1�
D��
���@�A�A����+�+�-�-rRc�&�URU5nURRU5nUc,UcSnOpURRRU5nOJURScgURSS:Xa$URS(aURSnOSnUb$URRRXRS9nO/nUcUcgU$UR(dU$[R"U/URU5U5$)Nr'rr-)�default_revision)r�rr�rrUr�r0�	versionedr��
annotate_iterr&r�
reannotater�)rNr�r�rkr'rU�old_annotations       r<r��"InventoryPreviewTree.annotate_iter�s
���,�,�t�$���*�*�.�.�w�7���?������?�?�0�0�8�8��A���|�|�A��&���|�|�A��&�(�W�->�->�q�-A�"�<�<��?������!�_�_�2�2�@�@��A��N� �N��?����%�%��&�&�!�!��"�"�
��d�1�1�$�7�9I�
�	
rRc#�# �URR/n[U5S:�Ga�UR5n/n/nUR	S5nUR
R
U5nURRU5 URU5H�nUR
R
U5nURRU5n	URRU5 URRU5n
U
bU
nO'Sn
URRRU5nUS:XaURU5 URX�U
SU45 M� UR5 URU5(aXd4v� UR![#XPR
RSS95 [U5S:�aGM�gg7f)Nrrx�unknownr,T)r�r9)rrr~rt�rstriprrgrlr_ror�rUr�r�rrzr�r�)rNr�pendingr�r��subdirsr�ry�path_from_rootrIr0�versioned_kinds            r<�walkdirs�InventoryPreviewTree.walkdirs�s~����?�?�'�'�(���'�l�Q�����
�I��H��G��]�]�3�'�F��+�+�4�4�Y�?�K��O�O�)�)�)�4� �.�.�y�9��!%�!2�!2�!;�!;�H�!E���?�?�5�5�h�?�����-�-�h�7����1�1�(�;���#�%)�N�$�D�%)�_�_�%:�%:�%F�%F�~�%V�N�!�[�0��N�N�8�,�����4��~� V�W�:�
�M�M�O��%�%�f�-�-�!�+�+��N�N��w�$5�$5�$>�$>��M�
�/�'�l�Q���s�GG�Gc��URU5nURU5(d%URRR	U5$URU5nURR
U5n[R"U5$)zSee Tree.get_symlink_target.)	r�r(rrUr4r<r�r
r6�rNr�rkrfrds     r<r4�'InventoryPreviewTree.get_symlink_target	sq���,�,�t�$���#�#�G�,�,��?�?�(�(�;�;�D�A�A��&�&�t�,�����*�*�8�4������%�%rRc�
�URU5nURU5(d%URRR	U5$URU5nURR
U5n[US5$)zSee Tree.get_file.r.)r�r(rrUr2r<r�r1r�s     r<r2�InventoryPreviewTree.get_file
	sm���,�,�t�$���#�#�G�,�,��?�?�(�(�1�1�$�7�7��&�&�t�,�����*�*�8�4���D�$��rR)rr)�downr\r")FNTF)FNNNTF)rC)$r�r�rrrrErr�r#r(r6r9rKrrBr�rOr�r�rWr\rerjrHrtr�r�rror��CURRENT_REVISIONr�r�r4r2rr�rRr<r�r��s���D�
��0��
?�

��&��>��>���H�8�	B�&�(�	�>��QV� 3�D
8�4�H ������.�B4A�3Q�3Q�%
�N�:&� rRr�c�>�[R"5nURUR55 URUR"55 UbURUR	55 [XX#U5sSSS5 $!,(df   g=f)aMCreate working tree for a branch, using a TreeTransform.

This function should be used on empty trees, having a tree root at most.
(see merge and revert functionality for working with existing trees)

Existing files are handled like so:

- Existing bzrdirs take precedence over creating new items.  They are
  created as '%s.diverted' % name.
- Otherwise, if the content on disk matches the content we are building,
  it is silently replaced.
- Otherwise, conflict resolution will move the old file to 'oldname.moved'.

:param tree: The tree to convert wt into a copy of
:param wt: The working tree that files will be placed into
:param accelerator_tree: A tree which can be used for retrieving file
    contents more quickly than tree itself, i.e. a workingtree.  tree
    will be used for cases where accelerator_tree's content is different.
:param hardlink: If true, hard-link files to accelerator_tree, where
    possible.  accelerator_tree must implement abspath, i.e. be a
    working tree.
:param delta_from_tree: If true, build_tree may use the input Tree to
    generate the inventory delta.
N)�
contextlib�	ExitStack�
enter_contextr�r�_build_tree)r�wt�accelerator_tree�hardlink�delta_from_tree�
exit_stacks      r<�
build_treer�	su��2
�	�	�	�:�� � ��!3�!3�!5�6�� � ����!1�2��'��$�$�%5�%?�%?�%A�B��4�%5��Q�
 �	�	�s�A.B�
Bc���[5nSU5H�upEUS:wa[U5eURUS5(aUSnUSnO
USnUSnURU5nXb;a<UR	U5S-n	URX�U5 UR
USXg45 M�UR	U5S-n	URX�U5 UR
USXv45 M� U$)	Nc3�.# �UHoSU4v� M
 g7f�rNr�)r�rbs  r<r��#resolve_checkout.<locals>.<genexpr>:	s���:�	�1��d�A�Y�	�s�r�r'rz	.divertedzDiverted toz.movedzMoved existing file to)r�r��new_contentsrprornr�)
r
r��divert�
new_conflictsr$r#r%�old_filerpr�s
          r<�resolve_checkoutr�8	s����E�M�:�	�:����[� � ��(�(�
�?�?�8�A�;�'�'���{�H���{�H���{�H���{�H����x�0�����}�}�X�.��<�H��N�N�8�8�<����v�}�h�I�J��}�}�X�.��9�H��N�N�8�8�<����v�'?��T�U�-;�.�rRc
�H
^&�[UR55H)upVUS:�dM
[R"URS9e 0n[
RR5n[SSU5n	UR"S5bVURS5UR"S5:wa1URUR"S55 UR5 UR5n
[5nU	R5 U
RS5U[!XS5'[
RR5n/n
Sn[#UR"55nU(a/nOSnUS:�a<[5nUR%5HunnUR'SU55 M  [UR("55GH�ununnUR'[+S5U[#U
5-
U5 UR,cMAS	nUR.nU(aUR1SUUU45 UW;a�UR3U5n[4R6"U5nUS
:Xa1[8R:R=U5 UR?U5 UU;a<[CUUUUU5(a(U
REU
RU55 US
:XaSnU[4RF"U5nURHS:XaU
RKURLU5nUUU'U
ROUUS
9 URP"U5nU(aU
RSUU5 UUURT4nU
R1UU45 O[WUU
UUU5UU'U(dGM�UUnU
RU5n[YU
UU5 GM� US-[#U
5-
n[[X�X�UX#5 SSS5 U	R5 UV s1sHn UU iM
 sn m&U&4Sjn![]U
U!S9n"[#U"5S:�aSnU
R_U"5n#U#H"n$[`Rb"[eU$55 M$ URgU#5 U
RkSWS9n%U
Rm5 URo5 U%$![R@a GN0f=f!,(df   N�=fs sn f![Rha Nyf=f!U
Rm5 URo5 f=f)zSee build_tree.r)r�zBuild phaserrCNc3�*# �UH	oSv� M g7fr�r�)r�rgs  r<r��_build_tree.<locals>.<genexpr>|	s���)>��1�A�$��s�z
Building treeFr,Tr-rjr'c�>�[XT5$r\)r�)r�rb�divert_transs  �r<�resolver�_build_tree.<locals>.resolver�	s���#�A�,�7�7rR)�	pass_func)r�r�)8r�rOr�WorkingTreeAlreadyPopulated�basedirr
r�r�rr��set_root_id�flushrr��
next_phaserKr&r~r�r�rHrr�rkr�r�r
r�r�
ControlDirr1r��NotBranchErrorr=r��dirnamer0rgrdrrr=r"�	text_sha1r#r �
_create_filesr$r�rr{r��
add_conflictsr�r�rY�finished)'rr�r�r�r�r��_unused�
file_trans_id�top_pb�ppr
r�rB�deferred_contents�totalr��existing_files�_dir�filesr8r7�reparentrkr9r0r�rfr$�
trans_data�new_trans_id�
old_parentr�rgr�r�r�r#�resultr�s'                                      @r<r�r�T	s����!�"�"8�"8�":�;�����7��4�4�"�*�*�E�E�<��M�
�]�]�
.�
.�
0�F�	�}�a��	0�B��|�|�B��#��:�:�b�>�T�\�\�"�-�-��N�N�4�<�<��+�,��H�H�J�	����B�
�U�F�W�
�
�
��:<�:O�:O�PR�:S�
�(��2�6�7�
�]�]�
.�
.�
0�B� "���C���0�0�2�3�E��$&�!�$(�!��q�y�!$���#%�;�;�=�K�D�%�"�)�)�)>��)>�>�$1�+4�T�5M�5M�5O�+P�'��'�i���	�	�'�/�2�C�#�>O�:P�4P�RW�X��?�?�*�� ���-�-��"�%�,�,�d�I�w��-N�O���.�"$�*�*�Y�"7�K�"�,�,�[�9�D��{�*�2�&�1�1�6�6�{�C�#�J�J�y�1� ��.�>��e�Y��k�4�4��*�*�2�+@�+@��+K�L��;�.�'+�H�)�'�/�/�)�*D�E�	��:�:��'� "�~�~�e�j�j�)�D�H�/7�M�)�,��O�O�H�g�O�>�!%�!3�!3�I�!>�J�!��,�,�Z��B�"*�I�u���!G�J�%�,�,�i��-D�E�/;�!�2�u�i��0�M�)�,��8�#0��#;�L�!#�!6�!6�y�!A�J�&�r�:�|�D�W,Q�X�1�W�s�#4�5�5�F���+��9I�
�}1�B	�
�
��28�9�&�Q�
�a�(�&�9��	8�*�"��A�
��}���!� $���%�%�m�4�	�!�H��M�M�#�h�-�(�"�	����Y�'����t�?P��Q��
���
������M��m &�4�4�!� �!��?1�
0��D:���*�*�	��	��	���
�����s��9AS?�D%S�+R4�
DS�!AS�(S?�S �AS?�1S%�S?�4S�S�S�S�
S�S?�%S<�9S?�;S<�<S?�?"T!c
�B�[U5U-nURnUcUn	GO�URUSS9n
U
Vs/sHDnUR(aMURSURS:waM8UR
PMF nnUR
5(a9UV
Vs/sH*up�[URU/55(aM'X�4PM, nn
n[U5n/n	SnUGHununnnURU5nUcU	RUUUU445 M7UR[S5X�-U5 U(a"URURU5U5 O~UR!U5n["R$"U5nUR
5(a(UR'U5n[)UU[+UU55nUR-UUUS9 SSS5 US-
nGM XO-
n[/UR0"U	55HyunuunnnnUR
5(a(UR'U5n[)UU[+UU55nUR-UUUS9 UR[S5X�-U5 M{ gs snfs snn
f!,(df   N�=f)NT)r�rr'zAdding file contentsr)r~rUror&r$r��supports_content_filteringrG�iter_search_rulesr`r�r�r�rr�r�r2r
�
file_iterator�_content_filter_stackrrr!r��iter_files_bytes)r
r�
desired_filesrBr�r�r�r�r��new_desired_filesri�change�	unchanged�tp�ap�count�_unused_tree_pathrfr8r��accelerator_pathrg�chunks�filtersr#s                         r<r�r��	s����
���'�E�	���B���)���,�,�T�T�,�J���
����&�&�
�+1�*;�*;�A�*>�&�BS�BS�TU�BV�*V�
�F�K�K��	�
��6�6�8�8�!*�� )�H�R��,�>�>��t�D�E���� )�
��
��O�	�����CP�?��?��)�Y�(�}�}�Y�7���'�!�(�(�)�h�	�9�5U�)V�W���I�I�g�4�5�u�~�u�M���"�"�#3�#;�#;�<L�#M�x�X�%�.�.�/?�@�A�$�2�2�1�5�F��4�4�6�6�"$�":�":�9�"E��!6�"�G�-A�)�T�-R�"���N�N�6�8�)�N�D�A�
�Q�J�E�#DQ�$	���?H����/�0�@�;��;�0��9�i�(��(�(�*�*��.�.�y�9�G�,��'�#7�	�4�#H��H�	���x��	��:�
�	�	�'�0�1�5�>�5�I�@��G
���"A�@�s*�J�J�1J�&J
�J
�1A%J�
J	)NFF)Er�r<r5rrlrrrrCrrrr	r
rrr
rrr�rr�r�rr�i18nr�mutabletreer�progressrrrrrrrrrrrrr r!r"r#r$r%r&r(r)r�r*r=r?rrrr"r�r+r�r�
InventoryTreer�r�r�r�r�r�rRr<�<module>r�s���$��	���!�
�
�
�)�*�A��%�$������$&�&���g?�
�g?�T�>G�G�(�'�.���,�<g1�)�g1�Tm�.�m�`23�-�23�jr �;�
�(C�(C�r �jR�B�8m�`3JrR

Youez - 2016 - github.com/yon3zu
LinuXploit