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/git/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

p��g�'���SSKrSSKrSSKrSSKrSSKJrJr SSKJrJ	r	 SSK
Jr SSKJ
r
JrJrJrJrJr SSKJr SSKJr SS	KJr SS
KJr SSKJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r' SSK(J)r)J*r* S
SK+J,r,J-r-J.r.J/r/J0r0 S
SK(J1r1J2r2J3r3J4r4 "SS\#5r5"SS\55r6"SS\65r7"SS\75r8"SS\ \15r9g)�N)�S_IEXEC�S_ISREG)�blob_from_path_and_stat�commit_tree)�Blob�)�annotate�errors�osutils�trace�ui�urlutils)�revision)�	transport)�gettext)�MutableTree)�ROOT_PARENT�
FinalPaths�
ImmortalLimbo�MalformedTransform�PreviewTree�ReusingTransform�TransformRenameFailed�
TreeTransform�
_FileMover�_TransformResults�joinpath�
unique_add)�	InterTree�
TreeChange�)�decode_git_path�encode_git_path�mode_is_executable�	mode_kind�object_mode)�GitTree�GitTreeDirectory�GitTreeFile�GitTreeSymlinkc�r^�\rSrSrSrS0U4Sjjr\S5rSrSr	Sr
SrS	rS1S
jr
SrS2SjrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrS3SjrS1SjrS1Sjr Sr!Sr"S r#S2S!jr$S"r%S4S#jr&S$r'S%r(S&r)S5S'jr*S(r+S)r,S*r-S+r.S,r/S6S-jr0S.r1S/r2U=r3$)7�TreeTransformBase�9z-The base class for TreeTransform and its kin.c�>�[TU]XS9 0Ul[5UlURS5UlX0l0Ulg)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�set�
_versioned�trans_id_tree_path�root�_case_sensitive_target�_symlink_target)�self�treer/�case_sensitive�	__class__s    ��6/usr/lib/python3/dist-packages/breezy/git/transform.pyr2�TreeTransformBase.__init__<sF���	�����%�!����%����+�+�B�/��	�&4�#�!���c�.�URR$�N)�_tree�mapping�r:s r>rD�TreeTransformBase.mappingPs���z�z�!�!�!r@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)rCr�hooks�unlock)r:�hooks  r>�finalize�TreeTransformBase.finalizeTsL���:�:����%�%�&6�7�D�����T�"�8��
�
������
r@c�~�UR5n[URX15 [URX25 U$)z&Assign a transaction id to a new path.)�	assign_idr�	_new_name�_new_parent)r:�name�parent�trans_ids    r>�create_path�TreeTransformBase.create_pathas1���>�>�#���4�>�>�8�2��4�#�#�X�6��r@c��g)z8Emulate moving the root by moving all children, instead.N�)r:rRrSs   r>�adjust_root_path�"TreeTransformBase.adjust_root_pathhs�r@c�"�URR5VVs/sHupU[:XdMUPM nnn[U5S:ag[U5S:wa[	S5eUSnX@R
;aUR
U5 OURU5 [URU55 UR5RU/5H/nURURU5URU5 M1 X@R;aUR!U5 OUR#U5 URUR$;aUR'UR5 URU	UR(U	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!r)rQ�itemsr�len�
ValueErrorr5�cancel_versioning�unversion_file�list�iter_tree_children�	by_parent�get�adjust_path�
final_namer7�
_new_contents�cancel_creation�delete_contents�_removed_contents�cancel_deletionrP)r:�k�v�	new_roots�old_new_root�childs      r>�fixup_new_roots�!TreeTransformBase.fixup_new_rootsksM��$(�#3�#3�#9�#9�#;�P�#;�4�1�q�K�?O�Q�#;�	�P��y�>�A����y�>�Q���<�=�=� ��|���?�?�*��"�"�<�0�����-�
	
�T�
$�
$�\�
2�3��^�^�%�)�)�,��;�E����T�_�_�U�3�T�Y�Y��F�<��-�-�-�� � ��.�� � ��.��9�9��.�.�.�� � ����+�
���\�*��N�N�<�(��AQs
�F�Fc�v�Uc[S5eURRU5nURU5$)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)r^rD�
parse_file_idr6)r:�file_id�paths   r>�trans_id_file_id�"TreeTransformBase.trans_id_file_id�s:���?��:�;�;��|�|�)�)�'�2���&�&�t�,�,r@c��XR;a[R"US9eURRU5 g)z$Schedule a file to become versioned.��keyN)r5r
�DuplicateKey�add)r:rTrus   r>�version_file�TreeTransformBase.version_file�s/�����&��%�%�(�3�3������H�%r@c�,�[UR5e)�%Undo a previous versioning of a file.)�NotImplementedErrorr_�r:rTs  r>r_�#TreeTransformBase.cancel_versioning�s��!�$�"8�"8�9�9r@c�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.
)
r4�
_needs_rename�
differencerP�difference_updaterQrgr5�_new_executability�update�sortedr�	get_paths)r:�filesystem_only�new_ids�	stale_ids�needs_rename�id_sets�id_sets       r>�	new_paths�TreeTransformBase.new_paths�s����%����*�*�5�5�d�n�n�E�I��'�'��(8�(8�9��'�'��(:�(:�;��'�'����8��-�-�8�8��C�L�#�%<�%<�=�G����� � ��"�"�����'�'��G��F��N�N�6�"���j��&�0�0��9�:�:r@c��XR;agXR;agURU5nUcgURR	U5$)NTF)r5�_removed_id�	tree_pathrC�is_versioned)r:rT�	orig_paths   r>�final_is_versioned�$TreeTransformBase.final_is_versioned�sJ�����&���'�'�'���N�N�8�,�	�����z�z�&�&�y�1�1r@c���URSLa
[5e/nUR5 UR5nUR	UR55 UR	UR
U55 UR	URU55 UR	UR55 UR	UR55 UR	UR55 U$)z:Find any violations of inventory or filesystem invariants.T)�_doner�_add_tree_childrenrc�extend�
_parent_loops�_duplicate_entries�_parent_type_conflicts�_improper_versioning�_executability_conflicts�_overwrite_conflicts)r:�	conflictsrcs   r>�find_raw_conflicts�$TreeTransformBase.find_raw_conflicts�s����:�:���"�$�$��	�	
���!��N�N�$�	�����+�+�-�.�����0�0��;�<�����4�4�Y�?�@�����2�2�4�5�����6�6�8�9�����2�2�4�5��r@c�T�UR5n[U5S:wa	[US9eg)Nr)r�)r�r]r)r:r�s  r>�_check_malformed�"TreeTransformBase._check_malformed�s,���+�+�-�	��y�>�Q��$�y�9�9�r@c�H�[UR55nURURVs/sHo R	U5S:XdMUPM sn5 UR
HtnUR
U5nUb5URRU5S:XaURU5 MJMLUR	U5S:XdMcURU5 Mv UHn[URU55 M gs snf![Ra M�f=f)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.
�	directoryN)
rarcr�rj�	tree_kindr�r�rC�stored_kind�append�_mod_transport�
NoSuchFilerb)r:�parents�trTrv�	parent_ids      r>r��$TreeTransformBase._add_tree_children�s����t�~�~�'�(������.�.�S�.�1�.�.��2C�{�2R�Q�.�S�	
��(�(�H��>�>�(�+�D�����z�z�-�-�d�3�{�B����x�0�C�����)�[�8����x�(�)�!�I���(�(��3�4�!��
T��&�0�0����s�D�D�0D	�	D!� D!c��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: {}, {}, {})rcrdrf�_tree_id_pathsr�_tree_path_idsr�lexistsrC�abspath�AssertionError�format)r:rRr��known_childrenrp�parent_path�
child_path�child_ids        r>�_has_named_child�"TreeTransformBase._has_named_childs����!�!�^�^�-�1�1�)�R�@�N�#�E����u�%��-��$��)�)�-�-�i��>������k�0�
��&�&�*�*�:�t�<�����?�?�4�:�:�#5�#5�j�#A�B�B� �1�8�8��(�S��
r@c�^^^�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$rB)r�)�baser�r:�	target_ids ���r>�<lambda>�:TreeTransformBase._available_backup_name.<locals>.<lambda>)s���t�4�4�T�9�n�Ur@)rcrdr�available_backup_name)r:rRr�r�s` `@r>�_available_backup_name�(TreeTransformBase._available_backup_names7������)�-�-�i��<���,�,��U�
�	
r@c#�# �URH\n[5nUnU[:wdMURU5 UR	U5nX1:XaSU4v� X2;aMPU[:waMAM^ g![
a Mnf=f7f)z$No entry should be its own ancestor.�parent loopN)rQr4rr}�final_parent�KeyError)r:rT�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#�# �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.
�symlinkNzversioning no contentszversioning bad kind)r5�
final_kindrC�supports_symlinks�versionable_kind)r:rT�kinds   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 executability�fileznon-file executabilityN)r�r�r�r�s  r>r��*TreeTransformBase._executability_conflictsLsO����/�/�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)rgr�rjrfr�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)
rPrQ�valuesrfr8�lowerr��sortr�r�)
r:rc�children�name_ids�	child_tidrR�	last_name�
last_trans_idrTr�s
          r>r��$TreeTransformBase._duplicate_entriescs�����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.TNF�missing parentr��non-directory parent)r\rr�)r:rcr�r��no_childrenr�r�s       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)
rC�_supports_executabler�r��os�stat�st_mode�umaskr�chmod_if_possible)r:rvrT�new_executabilityr��current_moder��to_modes        r>�_set_executability�$TreeTransformBase._set_executability�s����:�:�*�*�,�,� $� 7� 7�� A���j�j�(�(��.�G��7�7�7�+�3�3�L� ������������&�%�5�&�.�9���%�'��u��v�~�-�G��%�'��u��v�~�-�G��&��/���%�%�g�7�-r@c�L�URX5nUbURXCS9 U$)z1Helper function to create a new filesystem entry.)ru)rUr~�r:rRr�rurTs     r>�
_new_entry�TreeTransformBase._new_entry�s.���#�#�D�4�������h��8��r@c�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)r:rRr��contentsru�
executablerrTs        r>�new_file�TreeTransformBase.new_file�sB���?�?�4�G�<��	
����$��7��!��"�"�:�8��r@c�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.
)r�create_directoryrs     r>�
new_directory�TreeTransformBase.new_directory�s'���?�?�4�G�<�����h�'��r@c�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)r:rRr��targetrurTs      r>�new_symlink�TreeTransformBase.new_symlink�s'���?�?�4�G�<�����F�-��r@c�,�[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�r:rTr�s   r>r�TreeTransformBase.new_orphan�s��"�$�/�/�2�2r@c��/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)rcrjr�r�)r:�dir_id�orphansr�s    r>�_get_potential_orphans�(TreeTransformBase._get_potential_orphans�sc�������)�&�1�I��2�2�2���*�*�9�5�5����y�)������2��r@c�t�[UR5nURUR5 URUR5 URUR
5 URUR5 URUR5 URUR5 U$)z:Return the set of transform ids affected by the transform.)	r4r�r�r5rjrgr�rPrQ)r:�	trans_idss  r>�
_affected_ids�TreeTransformBase._affected_idss�����(�(�)�	�������)�����/�/�0�����+�+�,�����0�0�1�������(�����)�)�*��r@c��[U5nUR5n/nUGH�nURU5nSnUcSnOURR	U5nU(d	U(dSnURU5n	U	cSn
OUR
U5n
U(d	U
(dSn	U(a3[URRU/S95SnURnO'SnUcSnO[RRU5nUbURRX�5up�nOSn
SnURU5nURU5nXPR ;aUR UOUnU(a	U
U:waSnOUS;aXPR";aSnU(dX�:XaXi:XaUU:Xa	UU:XaGM�Xi4S:XaGM�UR%['Xi4UX�4UU4U
U4UU455 GM� Sn[)[+UUS	95$)
z�Produce 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.
FN��specific_filesr!T)r�r��NNc�b�URS=(d SURS=(d S4$)Nrr0r!)rv)�cs r>�path_key�0TreeTransformBase.iter_changes.<locals>.path_key`s%���F�F�1�I�O��Q�V�V�A�Y�_�"�5�5r@rz)rr!r�rCr��get_pathr��next�iter_entries_by_dirrRr�rv�basename�_comparison_datarfr�r�rgr�r �iterr�)r:�want_unversioned�final_pathsr �resultsrT�	from_path�modified�from_versioned�to_path�to_versioned�
from_entry�	from_name�	from_kind�from_executable�
from_stats�to_name�to_kind�
to_executabler)s                    r>�iter_changes�TreeTransformBase.iter_changes
s��!��&���&�&�(�	���!�H����x�0�I��H�� �!&��!%���!8�!8��!C��#�N� �	�!�*�*�8�4�G���$��#�6�6�x�@��#�L����!��J�J�2�2�9�+�2�N����
�'�O�O�	�!�
��$� $�I�!#��� 0� 0�� ;�I��$�9=���9T�9T��:�6�	�J�!�	�"'���o�o�h�/�G��o�o�h�/�G��6�6�6��'�'��1�$�
�
�)�w�"6����/�/�X�AS�AS�5S����"�2��(���(�#�}�4���#�|�3���N�N���(��#�2���(���(�$�m�4�
�	
�}"�R	6��F�7��1�2�2r@c��[U5$)z�Return a tree representing the result of the transform.

The tree is a snapshot, and altering the TreeTransform will invalidate
it.
)�GitPreviewTreerEs r>�get_preview_tree�"TreeTransformBase.get_preview_treees���d�#�#r@c	��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�r4rgr�r5r�r
�StrictCommitFailed�last_revision_info�
_mod_revision�
NULL_REVISIONr^r�rC�get_revision_idr��decoder0rI�Commit�update_revprops�get_commit_builderrEra�record_iter_changesrA�finish_inventory�set_last_revision_info)r:�branch�message�
merge_parents�strictrJrKrL�authorsrMrN�unversionedrT�revno�last_rev_id�
parent_idsrI�builder�previews                   r>rI�TreeTransformBase.commitms���B	
������d�0�0�1�<�<�S����=Q�R�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��=��r@c��URU5nUbURRU5S:wagU$![Ra gf=f)Nr�)r�rCr�r�r��r:rTrvs   r>�_text_parent�TreeTransformBase._text_parent�sW���~�~�h�'��	��|�t�z�z���t�4��>�� ?�����(�(�	��	�s�"9�A�Ac�d�URU5nUcgURRU54$)z/Get texts for compression parents of this file.rX)rirC�
get_file_textrhs   r>�_get_parents_texts�$TreeTransformBase._get_parents_texts�s2��� � ��*���<���
�
�(�(��.�0�0r@c�d�URU5nUcgURRU54$)z/Get lines for compression parents of this file.rX)rirC�get_file_linesrhs   r>�_get_parents_lines�$TreeTransformBase._get_parents_lines�s2��� � ��*���<���
�
�)�)�$�/�1�1r@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)r:rrT�mode_idrs     r>r�TreeTransformBase.create_file�s��"�$�"2�"2�3�3r@c�,�[UR5e)�?Schedule creation of a new directory.

See also new_directory.
)r�r
r�s  r>r
�"TreeTransformBase.create_directory�s��
"�$�"7�"7�8�8r@c�,�[UR5e)�YSchedule creation of a new symbolic link.

target is a bytestring.
See also new_symlink.
)r�r�r:rrTs   r>r� TreeTransformBase.create_symlink�s��"�$�"5�"5�6�6r@c�,�[UR5erB)r��create_tree_referencer|s   r>r�'TreeTransformBase.create_tree_reference�s��!�$�"<�"<�=�=r@c�,�[UR5e)�!Schedule creation of a hard link.)r��create_hardlink)r:rvrTs   r>r��!TreeTransformBase.create_hardlink����!�$�"6�"6�7�7r@c�,�[UR5e)�)Cancel the creation of new file contents.)r�rhr�s  r>rh�!TreeTransformBase.cancel_creation�r�r@c�,�[UR5e)�XApply 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 _mover: Supply an alternate FileMover, for testing
)r��apply)r:�no_conflicts�_movers   r>r��TreeTransformBase.apply�s��"�$�*�*�-�-r@c#�|# �U(dg[U5nSSKJnJn UGHnUSS:XaU"UR	US55v� M+USS:Xa!U"UR	USS55v� MUUSS:XaU"UR	US55v� M|USS	:XaM�USS
:XaU"UR	US55v� M�USS:XaU"UR	US55v� M�USS:XaU"UR	US55v� M�[S
R
US55e g7f)z9Generate a list of cooked conflicts, sorted by file path.Nr!)�ContentsConflict�TextConflictrz
text conflictzcontents conflictr�rr�r�zdeleting parentr�zunknown conflict {})r�workingtreer�r�r+r�r�)r:�
raw_conflicts�fpr�r�r(s      r>�cook_conflicts� TreeTransformBase.cook_conflictss,�����
��
��?��A���t��&�"�2�;�;�q��t�#4�5�5��1��,�,�&�r�{�{�1�Q�4��7�';�<�<��1���$�"�2�;�;�q��t�#4�5�5��1��)�)���1��/�/�"�2�;�;�q��t�#4�5�5��1��*�*�"�2�;�;�q��t�#4�5�5��1���&�"�2�;�;�q��t�#4�5�5�$�%:�%A�%A�!�A�$�%G�H�H�%�s�D:D<)r8r3r9rCr5r7�NTrB�F)NNN)NFNNNNNNr&�FN)4�__name__�
__module__�__qualname__�__firstlineno__�__doc__r2�propertyrDrLrUrYrqrwr~r_r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
rrrrr!rArErIrirmrqrr
rrr�rhr�r��__static_attributes__�
__classcell__�r=s@r>r,r,9s ���7�"�(�"��"���G�,)�\	-�&�:�;�42��":�
5�2�<
�� >� 
?�I�)�2:�,8�&�NR��(
�
�	3��>	�V3�p$���������G�R�1�2�4� 9�7�>�8�8�.�I�Ir@r,c�^�\rSrSrSrSSjrSrSrSrSr	U4Sjr
S	rS
rSr
SSjrS
rSrSrSrSrSrSrSrSrSrSrU=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,r2�	_limbodir�_deletiondir�_limbo_filesr4�_possibly_stale_limbo_files�_limbo_children�_limbo_children_namesr��_creation_mtimerr��_create_symlinks)r:r;�limbodirr/r<s     r>r2�DiskTreeTransform.__init__$sn��	�"�"�4�r�B�!�� ������+.�5��(� "���%'��"� �U���#��� '� 9� 9�$�.�.� I��r@c��URcg[URR55nUR	UR
5 UR
SS9 UHn[R"U5 M [R"UR5 URb [R"UR5 ["R%U5 g![a*nUR[R:waeSnAM�SnAff=f![a [UR5ef=f![a! [R "UR5ef=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)rCrar�r�r�r�r�r�
delete_any�OSError�errno�ENOENTr�rr�r
�ImmortalPendingDeletionr,rL)r:�limbo_pathsrv�es    r>rL�DiskTreeTransform.finalize>sA���:�:���	-��t�0�0�7�7�9�:�K����t�?�?�@����T��*�#����&�&�t�,�$�
4��"�"�4�>�>�2�
H��$�$�0��&�&�t�'8�'8�9�
�&�&�t�,��#���w�w�%�,�,�.��/�����
4�#�D�N�N�3�3�
4���
H��4�4�T�5F�5F�G�G�
H��
�&�&�t�,�sZ�AE*�#C"�9E*�> D�-D<�"
D�,D�E*�D�E*� D9�9E*�<+E'�'E*�*Fc�B�[R"UR5$)z4Check if the limbo path supports the executable bit.)r�supports_executabler�rEs r>�_limbo_supports_executable�,DiskTreeTransform._limbo_supports_executable`s���*�*�4�>�>�:�:r@c��URRU5nUcURU5nX RU'U$)z"Generate the limbo name of a file.)r�rd�_generate_limbo_path)r:rT�
limbo_names   r>�_limbo_name�DiskTreeTransform._limbo_namedsB���&�&�*�*�8�4�
����2�2�8�<�J�*4���h�'��r@c�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�pathjoinr�r�s  r>r��&DiskTreeTransform._generate_limbo_pathls/��	
�����x�(��������9�9r@c�r>�URRU5nURRU5n[TU]XU5 X0R
;aaX0R;aQURU/5 XB:waURURU5 XB:wdXQ:waURUU	ggggrB)rQrdrPr1rer�r��_rename_in_limbor��remover�)r:rRrSrT�previous_parent�
previous_namer=s      �r>re�DiskTreeTransform.adjust_pathus�����*�*�.�.�x�8�����*�*�8�4�
�
���D�(�3��(�(�(�X�=O�=O�-O��!�!�8�*�-��(��$�$�_�5�<�<�X�F��(�M�,A��.�.��?�
�N�-B�	.P�(r@c��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�r�r}rgr�r��renamer��_limbo_descendantsr])r:r rT�old_path�new_path�
descendant�	desc_paths       r>r��"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�!�!�*�-�@�"r@c��[URRU/55n[U5H#nUR	URU55 M% U$)z@Return the set of trans_ids whose limbo paths descend from this.)r4r�rdrar�r�)r:rT�descendantsr�s    r>r��$DiskTreeTransform._limbo_descendants�sM���$�.�.�2�2�8�R�@�A���{�+�J����t�6�6�z�B�C�,��r@c�,�[UR5erB)r��	_set_mode�r:rTru�typefuncs    r>r��DiskTreeTransform._set_mode�s��!�$�.�.�1�1r@c�b�URU5n[US5n[URUS5 UR	U5 SSS5 URU5 UR
X#[5 Ub&U[R"U54URU'gg!,(df   N_=f)rt�wbr�N)r��openrrg�
writelines�
_set_mtimer�rr�lstatr3)r:rrTrurrR�fs       r>r�DiskTreeTransform.create_file�s�������)��
�$��
���t�)�)�8�V�<�
�L�L��"��	
��������x�'�2���.2�G�M�M�$�4G�-H�D� � ��*���
�s�)B � 
B.c�L�[R"URU55$rB)r��readlinkr�r�s  r>�_read_symlink_target�&DiskTreeTransform._read_symlink_target�s���{�{�4�+�+�H�5�6�6r@c��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)r��timer��utime�r:rvs  r>r��DiskTreeTransform._set_mtime�s;��
���'�#'�9�9�;�D� �
����,�,�d�.B�.B�C�Dr@c�\�URU5n[R"X5 [URUS5 g![a:nUR[R
:wae[R"U5eSnAff=f![a [R"U5 ef=f)r�Nr�)r�r��linkr�r��EPERMr
�HardLinkNotSupportedrrg�
BaseException�unlink)r:rvrTrRr�s     r>r��!DiskTreeTransform.create_hardlink�s�������)��	4��G�G�D��
	��t�)�)�8�V�<���	4��w�w�%�+�+�%���-�-�d�3�3��	4���	�
�I�I�d�O��		�s"�A�B	�
B�5B�B�	"B+c�|�[R"URU55 [URUS5 g)rxr�N)r��mkdirr�rrgr�s  r>r
�"DiskTreeTransform.create_directory�s-��
	����!�!�(�+�,��4�%�%�x��=r@c�`�UR(a&[R"XRU55 ON[	U5RU5n[R"SRU55 XRU'[URUS5 g![a SnNYf=f)r{Nz1Unable to create symlink "{}" on this filesystem.r�)
r�r�r�r�rr+r�r�warningr�r9rrg)r:rrTrvs    r>r� DiskTreeTransform.create_symlink�s���� � ��J�J�v�/�/��9�:�
�!�$�'�0�0��:��
�M�M�C�J�J�4�P�
�.4� � ��*�	�4�%�%�x��;���
���
�s�B�B-�,B-c��[R"URU55 [URX!5 [UR
US5 g)r{�tree-referenceN)r�r�r�r�_new_reference_revisionrg)r:�reference_revisionrTs   r>r�'DiskTreeTransform.create_tree_reference�s>��	����!�!�(�+�,��4�/�/��N��4�%�%�x�1A�Br@c�2�URU	XR;a
URU	URRU5nUb+UR	U5 URU	UR
U	[R"URU55 g)r�N)	rgr3r�rdr�r�rr�r�)r:rTr�s   r>rh�!DiskTreeTransform.cancel_creations������x�(��+�+�+��$�$�X�.��'�'�+�+�H�5�����!�!�(�+��$�$�X�.��*�*�8�4����4�+�+�H�5�6r@c�l�URR5nURS5nU"XU5 g)Nztransform.orphan_policy)rC�get_config_stackrd)r:rTr��conf�
handle_orphans     r>r�DiskTreeTransform.new_orphans-���z�z�*�*�,�����!:�;�
��d�i�0r@c
���URU5n[U5nURU5nXR;GapUR	U5n[
R"U5n[UR5nURU5nURRRU5n	URRR[
RRU55n
US:Xa[X�RU5U
S9U4$[!UR5n[#X{5 [%['U5U5nUS:Xa"[)X�U
[+UR,55U4$US:Xa-[/U	UUU
UR0[3UR,5S9U4$[5U5eXR6;agUR9U5n
U
cgURRRU5n	US:XaSn
OBURRR[
RRU55n
[;URR=U
/S95S	nX�lX�l X�4$![Bam UREU5S:Xa[X�RU5U
S9U4s$O6![Fa)nURH[HRJ:waeSnAOSnAff=fgf=f)
Nr�)r�r�r�)r	r��git_sha1�	text_sizer&r0r$r!)&r�rr+rgr�r�r�r%r�rfrCrD�generate_file_idrv�dirnamer(r$r&rr#r*r"�datar)�idr]r�rjr�r,r-rur��
StopIterationr�r�r��ENOTDIR)r:rTr�r�r�rv�str�rRrur�r	�blobr��ier�s                r>�final_entry�DiskTreeTransform.final_entrys����.�.�x�8��
��
���K�K��)�	��)�)�)��#�#�H�-�D����$��B��R�Z�Z�(�D��?�?�8�,�D��j�j�(�(�9�9�)�D�G��
�
�*�*�;�;�B�G�G�O�O�I�<V�W�I��{�"�'��_�_�X�6�)��� � �,�B�J�J�7�J���)�*�?�4�+@�"�E�D��y� �%��9�o�d�i�i�.H��� � ����"���)�'�!�W�W�!�$�)�)�n�
� � � �%�T�*�*�
�/�/�
/�����x�0�I�� �!��j�j�(�(�9�9�)�D�G��B�� �	� �J�J�.�.�?�?��G�G�O�O�I�.��	�
"��$�*�*�8�8���8�T�U�VW�X��$�
�(���'�'�� �	
"���~�~�h�/�;�>�/�#�_�_�X�%>�)� �'� (�(�?�����w�w�%�-�-�/��0����"�	
"�sB�4I9�9
K0�/J7�3K0�6K0�7
K*�K%� K0�%K*�*K0�/K0c��XR;a{URU5n[R"U5n[	UR
5nUS:Xag[
UR
5n[XE5n[[U5U5nXv4$XR;agURU5nURRU5nURRU5n[XE5nUS:XaURRU5n	O4US:XaURR!U5n	OUS:Xag[#U5e[$R&"U	5nXv4$)Nr�r&r�r�)rgr�r�r�r%r�r$r&rr#rjr�rCr��
is_executable�get_symlink_targetrlr�r�from_string)
r:rTrvrr�r	�moderr�rs
          r>�final_git_entry�!DiskTreeTransform.final_git_entrySs+���)�)�)��#�#�H�-�D����$��B��R�Z�Z�(�D��{�"�!�+�B�J�J�7�J��t�0�D�*�?�4�+@�"�E�D�"�z��!�/�/�
/�����x�0�I��:�:�?�?�9�-�D����1�1�)�<�J��t�0�D��y� ��:�:�8�8��C������:�:�3�3�I�>����$�!�$�T�*�*��#�#�H�-�D��z�r@)	r�r�r�r�r�r�r�r�r�r�r&)r�r�r�r�r�r2rLr�r�r�rer�r�r�rr�r�r�r
rrrhrrrr�r�r�s@r>r�r�!sv���6�J�4 -�D;��:�	O�:�2�2�I�47�E��">�<�,C�7�1�
<"�|�r@r�c�b�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSSjrSr
S
rSrSrg)�GitTreeTransformipa[	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.

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.
Nc��UR5 [R"URR	S55n[
R"U[R5 [R"URR	S55n[
R"U[R5 0Ul0Ul
[RXX2UR 5 X@lg![a UR5 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�ExistingPendingDeletionr�rJ�
_realpaths�	_relpathsr�r2r<r�)r:r;r/r��deletiondirs     r>r2�GitTreeTransform.__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(C0�0Dc�V�URRU5nX R;aURU$[RRU5up4X0R;a,[RRU5URU'URUn[R"X45nX0R;a6[R"URUU5nURS5nOURRU5nXPRU'U$)z%Get the canonical tree-relative path.z/\)rCr�r'r�rv�splitr&�realpathrr��rstrip�relpath)r:rv�absrr.r.s      r>�canonical_path�GitTreeTransform.canonical_path�s����j�j� � ��&���.�.� ��>�>�#�&�&��G�G�M�M�#�.����/�/�)�')�w�w�'7�'7��'@�D�O�O�G�$��/�/�'�*�����w�1���n�n�$��&�&�t�~�~�g�'>��I�G��n�n�U�+�G��j�j�(�(��-�G�%���s���r@c���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)r�rdr�	file_kindrCr�r�r�rhs   r>r��GitTreeTransform.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)r�r�r�r�rCr�r�r�r�r�rrr�r�)r:rTrur�r�rr�s       r>r��GitTreeTransform._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�z2Iterate through the entry's tree children, if any.N)r�r�r��listdirrCr��NotADirectoryError�FileNotFoundErrorr�is_control_filenamer6)r:r�rvr�rp�	childpaths      r>rb�#GitTreeTransform.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)rQrdrgrPr�r4r�r8r\r�r�r�rr�r�r})r:rTrS�use_direct_path�filename�
l_filename�
l_trans_idr�s        r>r��%GitTreeTransform._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��r@c�:�URRU5 g)r�N)r5r�r�s  r>r_�"GitTreeTransform.cancel_versioningHs�������x�(r@c�B�[RSHnU"URU5 M U(dUR5 SUl[
RR5nUR[S5SS5 UR5nSnUc[5nOUnUR[S5SU-SU-5 URU5 UR[S5SU-SU-5 URU5nUR5 SSS5 URR#W5 SUlUR'5 [)WUR5$![a UR!5 ef=f!,(df   Nu=f)r��
pre_transformrzApply phaserr!NT)rrIrCr��rename_countr
�
ui_factory�nested_progress_barr�r�_generate_index_changesr�_apply_removals�_apply_insertions�apply_deletionsr��rollback�_apply_index_changesr�rLr)	r:r�r�rK�child_pb�
index_changes�offset�mover�modified_pathss	         r>r��GitTreeTransform.applyLsW�� �%�%�o�6�D�����T�"�7���!�!�#����
�]�]�
.�
.�
0�H��O�O�G�M�2�A�q�9� �8�8�:�M��F��~�"�����	
(�����
� 6��F�
�A��J�O��$�$�U�+�����
� 6��F�
�A��J�O�!%�!7�!7��!>��
�%�%�'�#1�$	
�
�
�'�'�
�6���
��
�
�� ���1B�1B�C�C��!�
���� ��
��1�
0�s%�*?F�*A&E1�F�1F
�
F�
Fc	�*�[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.
Tr�r0�
removing filer!N)r�r�r\r
rKrL�	enumerater�rr]rCr�rjr�rv�joinr��
pre_deleterPrQr�r�rJrr�r�)
r:rV�
tree_pathsrS�numrvrT�	full_path�delete_pathr�s
          r>rN� GitTreeTransform._apply_removalsts2���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�:�URSS9n/n[RR5n[	U5GH�unupgUS-S:Xa%UR[
S5U[U55 URRU5nXpR;a7URURU5U5 U=RS-
sl
XpR";dUR%U5(a XpR";aUR'U5 XpR(;aUR+Xg5 XpR,;a7UR,Uup�[.R0"U5nX�4UR,U'XpR2;dGMUURR55Hun
nn[7U
5U:XdM O [8R:"SU5 GM�URR<R>RA[BRDRGS	[HRKS
555nURM5 SSK'J(n U"5RSU5 [U[BRDRGUS5S
5nURWS5nURYSR[[BRDR]UU555 SSS5 GM� SSS5 UH$unnXpR^;dMUR^U	M& UR"Ra5 U$![a*n	U	R[R :waeSn	A	GN�Sn	A	ff=f!,(df   GMM=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!Nz$unable to find submodule for path %s�modulesrH)�BareLocalGitControlDirFormatz.git�w�.zgitdir: {}
)1r�r
rKrLr[r�rr]rCr�r�r�r�rJrr�r�rg�path_changedr�r�r�r3rr�r��_submodule_configr"rr��
controldir�control_transport�cloner�rvr\�submodule_namerT�
create_prefix�dirrg�initialize_on_transportr��
local_abspath�writer�r.r��clear)r:rVr�rWrSr_rvrTr`r��o_sha1�o_st_valr�submodule_path�_submodule_url�_submodule_name�submodule_transportrgr��submodule_abspath�_paths                     r>rO�"GitTreeTransform._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��;�;�;�
���5�5�7�	�&�&�'�*�>�:�d�B�!�8��
�
�&L�d�S� �*.�*�*�*?�*?�*Q�*Q�*W�*W������Y��0E�0E�g�0N�O�+�'�(�5�5�7�A�0�2�J�J�+���b�g�g�l�l�9�f�=�s�C�q�,?�,M�,M�c�,R�)����*�1�1� "�����0A�9� M���D�C�[*>�1�j )�O�E�8��,�,�,��%�%�h�/�	 )�
	
��� � �"����g1�"��7�7�e�l�l�2�!�3��"��LD�C��]1�
0�s]�A-N�!M�?C
N�.N�CN�AM9�'
N�
M6�M1�+N�1M6�6N�9
N	�	N�
Nc�2^�[TR5nURTR5 0n[5nTRTR
TRTR4HnURU5 M TRTR
4HnURU5 M [TR5nURU5 U4SjU5nURU5 UH<nTRU5S:XdMURU5 URU5 M> [[T5RU55n[U5[U5-n[ R"R%5n	['U5H=up�U
S-S:XaU	R[)S5X�5 TR*UnSX,'M? ['U5H�un
up�U
S-S:Xa(U	R[)S5U
[U5-U5 TRU5n
U
cMOTR/U5nU(dMiTRR1U5nTR2R1U5nTR4R1U5nU
UUU4X,'M� SSS5 UR75VVVVVs/sHununnnnUUUUU4PM snnnnn$![,a GM^f=f!,(df   NV=fs snnnnnf)	z6Generate an inventory delta for the current transform.c3�t># �UH-nTRU5TRU5:wdM)Uv� M/ g7frB)r�r�)�.0r�r:s  �r>�	<genexpr>�;GitTreeTransform._generate_index_changes.<locals>.<genexpr>�s/����
�#�!�t�~�~�a�'8�D�O�O�A�<N�'N�A�A�|�s�(8�	8r�rdrrZ)NNNNreN)r4r�r�rjrPrQr�rgr�r�r}r�r�rr�r]r
rKrLr[rr�r�r�rdr�r9r\)r:�
removed_id�changes�changed_idsr��changed_kindr�r��
total_entriesrSr_rTrvr��	versioned�
executabilityr��symlink_target�prlr��rrrs`                      r>rM�(GitTreeTransform._generate_index_changes�s������)�)�*�
����$�0�0�1����e���N�N�����#�#����	
�F�
���v�&�

��~�~�t�'7�'7�8�F����f�%�9��4�-�-�.���&�&�{�3�
�#�
��	���<�(��A����q�!�[�0����q�!��"�"�1�%���:�d�+�5�5�k�B�C�	��I���Z��8�
�
�]�]�
.�
.�
0�H�!*�:�!6�
���"�H��?��O�O�G�O�$<�c�Q���.�.�x�8�D�!9��
�"7�*3�9�)=�%��%�d��"�H��?��O�O��
�.��c�*�o�0E�}�����x�0���<�� �3�3�H�=�	� �� $� 7� 7� ;� ;�H� E�
�%)�%A�%A�%E�%E�h�%O�"�!%�!5�!5�!9�!9�(�!C���!�&�"�	!��
�*>�1�<>E�]�]�_�M�_�&9�q�.�1�a��R��A�q�"�b�!�_�M�M��1 �����
1�
0��<Ns7�5K?�K-�CK?�
L�-
K<�7K?�;K<�<K?�?
L
)r�r�r&r'rJrBr�)r�r�r�r�r�r2r0r�r�rbr�r_r�rNrOrMr�rXr@r>rrpsF��=�~(�6�&�H�45�"0�d)�&D�P/�:G�R<Nr@rc�@�\rSrSrSrSSjrSrSrSrSr	S	r
S
rg)�GitTransformPreviewiz�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�z�UR5 [R"SS9n[R	XXBU5 g)Nz
git-limbo-)�prefix)�	lock_read�tempfile�mkdtempr�r2)r:r;r/r<r�s     r>r2�GitTransformPreview.__init__!s.�������#�#�<�8���"�"�4�x�^�Lr@c��U$rBrXr�s  r>r0�"GitTransformPreview.canonical_path&s���r@c�|�URU5nUcgURRU5SnUS:XaSnU$)Nr�missing)r�rC�path_content_summary)r:rTrvr�s    r>r��GitTransformPreview.tree_kind)sC���~�~�h�'���<���z�z�.�.�t�4�Q�7���9���D��r@c��gr6rXr�s    r>r��GitTransformPreview._set_mode2s��	
r@c#�# �URUnURRU5H+n[	X#R
5nUR
U5v� M- g![a gf=f![Ra gf=f7fr9)	r�r�rC�iter_child_entriesrrRr6r�r�)r:r�rvrpr>s     r>rb�&GitTransformPreview.iter_tree_children;s����	��&�&�y�1�D�	����6�6�t�<��$�T�:�:�6�	��-�-�i�8�8�=���	��	���(�(�	��	�sF�B	�A�A
A/�B	�
A,�)B	�+A,�,B	�/B�B	�B�B	c�,�[UR5erBrrs   r>r�GitTransformPreview.new_orphanHs��!�$�/�/�2�2r@rXr�)r�r�r�r�r�r2r0r�r�rbrr�rXr@r>r�r�s&���M�
��
��3r@r�c���\rSrSrSrSrSrSrSrSr	SSjr
SS
jrSrSr
\R4S
jrSrSrSrSrSrSrSrSSjrSrSrSrSSjrSrSrg	) rDiLz:Partial implementation of Tree to support show_diff_trees.Fc��[R"X5 URRUlURRUl[U5UlgrB)rr2rC�storerDr�_final_paths)r:�	transforms  r>r2�GitPreviewTree.__init__Qs?�����T�-��_�_�*�*��
� ���.�.���&�y�1��r@c��g�NFrXrEs r>�supports_setting_file_ids�(GitPreviewTree.supports_setting_file_idsWs��r@c�.�URR$rB)�
_transformr�rEs r>r�� GitPreviewTree.supports_symlinksZs�����/�/�/r@c�6�URR5$rB)r�r�rEs r>r��#GitPreviewTree._supports_executable]s�����9�9�;�;r@c#�4# �URR/n[U5S:�GamUR5n/n/nUR	S5nUR
R
U5nURU5H�nUR
R
U5nURRU5n	URRU5n
U
bU
nO'Sn
URRRU5nUS:XaURU5 URX�U
SU45 M� UR5 URU5(aXd4v� UR[!XPR
RSS95 [U5S:�aGMlgg7f)Nr�/�unknownr�T)r{r�)r�r7r]�popr-r�r+�
_all_childrenrfr�rCr�r�r��
startswithr�r�)r:r��pendingr�r��subdirsr�r��path_from_rootr.r��versioned_kinds            r>�walkdirs�GitPreviewTree.walkdirs`sZ����?�?�'�'�(���'�l�Q�����
�I��H��G��]�]�3�'�F��+�+�4�4�Y�?�K� �.�.�y�9��!%�!2�!2�!;�!;�H�!E���?�?�5�5�h�?�����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�FF�FNc	�R�[R"X5RUUUUUUS9$)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_unchangedr%r/�extra_trees�require_versionedr1)rrdrA)r:�	from_treer�r%r/r�r�r1s        r>rA�GitPreviewTree.iter_changes{s7���}�}�Y�-�:�:�/�)��#�/�-�
;�
�	
r@c��URU5nUc[R"U5eX RR;a'URRU5n[
US5$X RR;a[R"U5eURRU5nURRRU5$)zSee Tree.get_file.�rb)�_path2trans_idr�r�r�rgr�r�rjr�rC�get_file)r:rvrTrRr�s     r>r��GitPreviewTree.get_file�s����&�&�t�,���� �+�+�D�1�1����4�4�4��?�?�.�.�x�8�D���d�#�#����8�8�8� �+�+�D�1�1��O�O�-�-�h�7�	����$�$�-�-�i�8�8r@c�j�URU5nUc[R"U5eX RR;a@URRU5nURRRU5$URRU5n[R"U5$)zSee Tree.get_symlink_target.)r�r�r�r�rgr�rCrr�rr�)r:rvrTr�rRs     r>r�!GitPreviewTree.get_symlink_target�s����&�&�t�,���� �+�+�D�1�1��?�?�8�8�8����1�1�(�;�I��?�?�(�(�;�;�I�F�F����*�*�8�4������%�%r@c�<�URU5nUcgURRU5nUb$URRR	XBS9nO/nURU5n[R"U/Xb5$![Ra gf=f)N)�default_revision)
r�r�r�rC�
annotate_iterrpr�r�r	�
reannotate)r:rvr�rTr��old_annotation�liness       r>r��GitPreviewTree.annotate_iter�s����&�&�t�,������O�O�-�-�h�7�	�� �!�_�_�2�2�@�@��A��N� �N�	��'�'��-�E��"�"�N�#3�U�M�M���(�(�	��	�s�B�B�Bc���[U[5(aU/:XaS/n[R"U6nUR	U5(dgUR
RRRU5$)Nr0)	�
isinstancerarr�r�r�rCrDr
r�s  r>�path2id�GitPreviewTree.path2id�sb���d�D�!�!��r�z��t���#�#�T�*�D�� � ��&�&�����$�$�,�,�=�=�d�C�Cr@c�z�URU5nUR5sSSS5 $!,(df   g=f)z{Return the byte content of a file.

:param path: The path of the file.

:returns: A single byte string for the whole file.
N)r��read)r:rv�my_files   r>rl�GitPreviewTree.get_file_text�s'���]�]�4�
 �G��<�<�>�!�
 �
 �s�,�
:c�L�[R"URU55$)zLReturn the content of a file, as lines.

:param path: The path of the file.
)r�split_linesrlr�s  r>rp�GitPreviewTree.get_file_lines�s ��
�"�"�4�#5�#5�d�#;�<�<r@c#��# �URRR5Vs1sHnURRU5iM  nnUR	URR
5 UR	URR5 UHBnURRU5(aM%URRU5v� MD gs snf7frB)
r�rC�extrasr6r�rgr�r�r��_determine_path)r:r��possible_extrasrTs    r>r��GitPreviewTree.extras�s�����_�_�*�*�1�1�3�
�3��
�O�O�.�.�q�1�3�	�
�	���t���<�<�=����t���:�:�;�'�H��?�?�5�5�h�?�?��'�'�7�7��A�A�(��

�s�'C(�%C#�A/C(�'C(c���URU5nURnURU5nURR	U5nUc4UbX#R
;agURRU5nUupWp�O�Sn	URU5n
X#R;aSnUS:XaN[R"U
5nURnUR5(dSnOUR[-nOSnSnUS:XaA[R "U
5n	[#U	[$5(d[R&"U	5n	UR(R	X(5nXWX�4$)N)r�NNNr�r�Fr�)r�r�r�rgrdrjrCr�r�r�r�r��st_sizer�r�rr�r��str�fsdecoder�)r:rvrT�ttr�r��summary�sizer	�link_or_sha1r��statvals            r>r��#GitPreviewTree.path_content_summary�s8���&�&�t�,��
�_�_���L�L��*�	����#�#�H�-���<�� �H�0D�0D�$D�2��h�h�3�3�I�>�G�3:�0�D�
�L��L�����1�J��5�5�5�'���v�~��(�(�:�.�������4�4�6�6�!&�J�!(���7�!:�J���!�
��y� �!�{�{�:�6��!�,��4�4�#%�;�;�|�#<�L��*�*�.�.�x�D�
��:�3�3r@c�~�URU5nUc[R"U5eX RR;a>URR
R
URRU55$URRU5n[R"U5nUR$)zSee Tree.get_file_mtime.)r�r�r�r�rgrC�get_file_mtimer�r�r�r��st_mtime)r:rvrTrRr�s     r>r��GitPreviewTree.get_file_mtimes����&�&�t�,���� �+�+�D�1�1��?�?�8�8�8��?�?�(�(�7�7����)�)�(�3��
����*�*�8�4���(�(�4�.�����r@c��URU5nUcgX RR;agX RR;agURR	U5nURR
R
U5$)NFT)r�r�r5r�r�rCr�)r:rvrTr�s    r>r��GitPreviewTree.is_versionedsp���&�&�t�,��������1�1�1�����2�2�2���O�O�-�-�h�7�	����$�$�1�1�)�<�<r@c#�# �U(a[S5eUR5HTup4URRU5upVUcM'U(dURS:waM@UbXA;aMJUcMOXE4v� MV g7f)Nz(follow tree references not yet supportedr�)r��_list_files_by_dirr�rr�)r:r%�recurse_nestedrTrv�entryr�s       r>r-�"GitPreviewTree.iter_entries_by_dirsw����%�&P�Q�Q�#�5�5�7�N�H�"&�/�/�"=�"=�h�"G��E��}���E�J�J�+�$=���)�d�.H��� ��k�!�8�s�A.A>�4
A>c#�# �[/n[U5S:�a�UR5n[UR	U55n[[
X0RRU555nURURS9 UR[U55 UHnXTUS4v� M [U5S:�aM�gg7f)Nrrz)
rr]r�rar��dict�zipr�r�r�rdr��reversed)r:�todorSr��pathsrTs      r>r��!GitPreviewTree._list_files_by_dir.s�����}���$�i�!�m��X�X�Z�F��D�.�.�v�6�7�H���X�'8�'8�'B�'B�8�'L�M�N�E��M�M�e�i�i�M�(��K�K���*�+�$���h��� 2�2�2�%�
�$�i�!�m�s�CC
�C
c�L�URRRU5$rB)r�rC�
revision_tree)r:rNs  r>r�GitPreviewTree.revision_tree9s�����$�$�2�2�;�?�?r@c�d�URRU5n[R"U5$rB)r�r�r�r�)r:rTrRs   r>�_stat_limbo_file�GitPreviewTree._stat_limbo_file<s$�����*�*�8�4���x�x��~�r@c���[5n/nUR5H�upEURRU5(dU(dM.UR	U5 URRU5upgUcMaURRU5 UR"[U5URU45 M� U(dSU4$[URU5U4$rB)r4r�r�r�r}rr��
add_objectr�r#r
r)r:r1�extrar�rTrv�ors        r>�git_snapshot�GitPreviewTree.git_snapshot@s������
��"�5�5�7�N�H��?�?�5�5�h�?�?�'���	�	�$���o�o�5�5�h�?�G�A��}��
�
�%�%�a�(��	�	�?�4�0�!�$�$��=�>�8����;���4�:�:�r�*�E�1�1r@c#��# �URU5nUc[R"U5eURU5H2nURRU5upEU(dM)UcM.Uv� M4 g7frB)r�r�r�r�r�r)r:rvrT�_child_trans_idr�r�s      r>r��!GitPreviewTree.iter_child_entriesPsi����&�&�t�,���� �+�+�D�1�1�#�1�1�(�;�O�"&�/�/�"=�"=�h�"G��E���� ��� <�s�A&A5�,	A5)r�rDr�)r0)FNNNTFr�r�)r�r�r�r�r��supports_file_idsr2r�r�r�r�rAr�rrQ�CURRENT_REVISIONr�r�rlrpr�r�r�r�r-r�rrr	r�r�rXr@r>rDrDLs���D���2��0�<��< ������
�09�	&�4A�3Q�3Q�N�"D�"�=�	B�4�@ �
=�"�(	3�@��2� 	r@rD):r�r�r�r�r�rr�
dulwich.indexrr�dulwich.objectsrr0r	r
rrr
rrrQrr��i18nr�mutabletreerr�rrrrrrrrrrrrr;rr rDr"r#r$r%r&r'r(r)r*r,r�rr�rDrXr@r>�<module>rs���$
�	���!�>� �=�=�(�*��%�
�
�
�
�)���I�H�eI�
�eI�PL�)�L�^
fN�(�fN�R
03�*�03�fM�[�'�Mr@

Youez - 2016 - github.com/yon3zu
LinuXploit