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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

p��g����SSKrSSKrSSKrSSKJr SSKJr SSKJrJ	r	J
r
JrJrJ
r
 \	R"\"5S5 SSKJrJrJr SSKJrJr SS	KJrJr SS
KJr SSKJrJr SSKJr S
r"SS\5r"SS\5r "SS\5r!"SS\5r""SS\5r#"SS\5r$Sr%"SS5r&"SS5r'"SS \R5r("S!S"\(5r)S#r*S$r+\RX\-\\'\.\./S44"5r/\/RaS%\+S&5 \/RaS'\*S(5 \/RcS%5 \Rd"S)\/S*S+S,9r3S-r4"S.S/5r5S0r6S1r7S2r8SGS3jr9S4r:SGS5jr;SHS6jr<SIS7jr=SGS8jr>S9r?S:r@S;rAS<rBS=rCS>rDS?rE\?\@\A\B\C\D\ES@.rFSISAjrG"SBSC5rHSDrI"SESF5rJg)J�N)�Callable�)�config)�errors�lazy_import�lock�osutils�registry�tracezD
from breezy import (
    ui,
    )
from breezy.i18n import gettext
)�BzrError�DuplicateKey�InternalBzrError)�ContentFilterContext�filtered_output_bytes)�
delete_any�pathjoin)�
ProgressPhase)�
FileExists�
NoSuchFile)�	InterTreezroot-parentc��\rSrSrSrSrSrg)�NoFinalPath�-zINo final name for trans_id %(trans_id)r
root trans-id: %(root_trans_id)r
c�2�XlURUlg�N)�trans_id�root�
root_trans_id)�selfr�	transforms   �2/usr/lib/python3/dist-packages/breezy/transform.py�__init__�NoFinalPath.__init__0s�� �
�&�^�^���)rrN��__name__�
__module__�__qualname__�__firstlineno__�_fmtr"�__static_attributes__�r$r!rr-s��X�D�,r$rc��\rSrSrSrSrg)�ReusingTransform�5z;Attempt to reuse a transform that has already been applied.r,N�r&r'r(r)r*r+r,r$r!r.r.5s��H�Dr$r.c��\rSrSrSrSrg)�MalformedTransform�9z)Tree transform is malformed %(conflicts)rr,Nr0r,r$r!r2r29s��6�Dr$r2c��\rSrSrSrSrg)�CantMoveRoot�=z7Moving the root directory is not supported at this timer,Nr0r,r$r!r5r5=s��D�Dr$r5c��\rSrSrSrSrSrg)�
ImmortalLimbo�Az�Unable to delete transform temporary directory %(limbo_dir)s.
    Please examine %(limbo_dir)s to see if it contains any files you wish to
    keep, and delete it when you are done.c�<�[R"U5 Xlgr)rr"�	limbo_dir)rr;s  r!r"�ImmortalLimbo.__init__Fs�����$��"�r$)r;Nr%r,r$r!r8r8As��.�D�#r$r8c��\rSrSrSrSrSrg)�TransformRenameFailed�Kz6Failed to rename %(from_path)s to %(to_path)s: %(why)sc�4�XlX lX0lX@lgr)�	from_path�to_path�why�errno)rrArBrCrDs     r!r"�TransformRenameFailed.__init__Ns��"�������
r$)rDrArBrCNr%r,r$r!r>r>Ks��C�D�r$r>c�(�X;a	[US9eX U'g)N)�key)r
)�maprG�values   r!�
unique_addrJUs��
�z��s�#�#���Hr$c��\rSrSrSrSrg)�_TransformResults�[c�F�[RU5 XlX lgr)�objectr"�modified_paths�rename_count)rrPrQs   r!r"�_TransformResults.__init__\s�������,��(�r$)rPrQN)r&r'r(r)r"r+r,r$r!rLrL[s��)r$rLc�^�\rSrSrSrS3SjrSrSrSrSr	S	r
S
rSrSr
S
rSrSrSrSrSrSrSrSrSrSrS3SjrSrSrS4SjrSrSrSrSr S r!S!r"S"r#S#r$S5S$jr%S3S%jr&S3S&jr'S'r(S(r)S)r*S6S*jr+S7S+jr,S,r-S-r.S.r/S/r0S0r1S1r2S2r3g)8�
TreeTransform�ba�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 only valid for the TreeTransform that generated them.
Nc���XlX lSUl0Ul0Ul0Ul0Ul0Ul[5Ul	0Ul
0Ul[5UlSUl
g)NrF)�_tree�_pb�
_id_number�_tree_path_ids�_tree_id_paths�	_new_name�_new_parent�
_new_contents�set�_removed_contents�_new_executability�_new_reference_revision�_removed_id�_done)r�tree�pbs   r!r"�TreeTransform.__init__�se���
������ ��� ������������!$����"$���')��$��5�����
r$c��U$)�Support Context Manager API.r,�rs r!�	__enter__�TreeTransform.__enter__�s���r$c�$�UR5 g)riN)�finalize)r�exc_type�exc_val�exc_tbs    r!�__exit__�TreeTransform.__exit__�s���
�
�r$c�,�[UR5e)zwIterate through the entry's tree children, if any.

:param trans_id: trans id to iterate
:returns: Iterator over paths
)�NotImplementedError�iter_tree_children�rrs  r!rv� TreeTransform.iter_tree_children�s��"�$�"9�"9�:�:r$c��U$rr,�r�paths  r!�canonical_path�TreeTransform.canonical_path�s���r$c�,�[UR5er)ru�	tree_kindrws  r!r�TreeTransform.tree_kind�s��!�$�.�.�1�1r$c�^�0n[TRR55nURU4Sj[TR555 UH)up4XA;a[5X'XR
U5 M+ U$)zzReturn a map of parent: children for known parents.

Only new paths and parents of tree files with assigned ids are used.
c3�H># �UHoTRU54v� M g7fr)�final_parent)�.0�trs  �r!�	<genexpr>�*TreeTransform.by_parent.<locals>.<genexpr>�s!����R�8Q�1��*�*�1�-�.�8Q�s�")�listr]�items�extendr[r_�add)r�	by_parentr�r�	parent_ids`    r!r��TreeTransform.by_parent�sv���
�	��T�%�%�+�+�-�.��
���R��T�=P�=P�8Q�R�R�#(��H��)�'*�u�	�$�� �$�$�X�.�$)��r$c�,�[UR5e)z~Release the working tree lock, if held.

This is required if apply has not been invoked, but can be invoked
even after apply.
)rurnrjs r!rn�TreeTransform.finalize�s��"�$�-�-�0�0r$c�~�UR5n[URX15 [URX25 U$)z&Assign a transaction id to a new path.)�	assign_idrJr\r]�r�name�parentrs    r!�create_path�TreeTransform.create_path�s1���>�>�#���4�>�>�8�2��4�#�#�X�6��r$c��Uc[S5eX0R:Xa[eXRU'X RU'g)z5Change the path that is assigned to a transaction id.NzParent trans-id may not be None)�
ValueErrorrr5r\r]r�s    r!�adjust_path�TreeTransform.adjust_path�s=���>��>�?�?��y�y� ���#'���x� �%+����"r$c�,�[UR5e)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.
)ru�adjust_root_path)rr�r�s   r!r��TreeTransform.adjust_root_path�s��"�$�"7�"7�8�8r$c�,�[UR5e)ahReinterpret 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.
)ru�fixup_new_rootsrjs r!r��TreeTransform.fixup_new_roots�s��"�$�"6�"6�7�7r$c�f�SRUR5nU=RS-
slU$)zProduce a new tranform id.znew-{}r)�formatrY)r�new_ids  r!r��TreeTransform.assign_id�s'��������1�����1����
r$c���URU5nXR;a8UR5URU'XRURU'URU$)z=Determine (and maybe set) the transaction ID for a tree path.)r|rZr�r[rzs  r!�trans_id_tree_path� TreeTransform.trans_id_tree_path�s_���"�"�4�(���*�*�*�(,���(8�D����%�=A���� 3� 3�D� 9�:��"�"�4�(�(r$c��URUnUS:Xa[$UR[RRU55$)z'Determine id of the parent in the tree.�)r[�ROOT_PARENTr��osr{�dirname)rrr{s   r!�get_tree_parent�TreeTransform.get_tree_parents=���"�"�8�,���2�:����&�&�r�w�w���t�'<�=�=r$c�d�URU5nUbURRU5 gg)z3Schedule the contents of a path entry for deletion.N)rr`r�)rr�kinds   r!�delete_contents�TreeTransform.delete_contents
s/���~�~�h�'�����"�"�&�&�x�0�r$c�:�URRU5 g)zCancel a scheduled deletion.N)r`�removerws  r!�cancel_deletion�TreeTransform.cancel_deletions�����%�%�h�/r$c�H�URU5 URU5 g)z&Delete and unversion a versioned file.N)r��unversion_filerws  r!�delete_versioned�TreeTransform.delete_versioneds�����X�&����H�%r$c�R�UcURU	g[URX!5 g)zBSchedule setting of the 'execute' bit
To unschedule, set to None.
N)rarJ)r�
executabilityrs   r!�set_executability�TreeTransform.set_executabilitys(��� ��'�'��1��t�.�.��Hr$c�0�[URX!5 g)z.Set the reference associated with a directory.N)rJrb)r�revision_idrs   r!�set_tree_reference� TreeTransform.set_tree_reference"s���4�/�/��Gr$c�,�[UR5e)z$Schedule a file to become versioned.)ru�version_file)rr�file_ids   r!r��TreeTransform.version_file&s��!�$�"3�"3�4�4r$c�,�[UR5e)z%Undo a previous versioning of a file.)ru�cancel_versioningrws  r!r��TreeTransform.cancel_versioning*s��!�$�"8�"8�9�9r$c�:�URRU5 g)z,Schedule a path entry to become unversioned.N)rcr�rws  r!r��TreeTransform.unversion_file.s�������X�&r$c�,�[UR5e)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.
)ru�	new_paths)r�filesystem_onlys  r!r��TreeTransform.new_paths2s��"�$�.�.�1�1r$c��XR;aXR;agURU$XR;agURU5$)z�Determine the final file kind, after any changes applied.

:return: None if the file does not exist/has no contents.  (It is
    conceivable that a path would be created without the corresponding
    contents insertion command)
�tree-referenceN)r^rbr`rrws  r!�
final_kind�TreeTransform.final_kind:sN���)�)�)��7�7�7�'��%�%�h�/�/�
�/�/�
/���>�>�(�+�+r$c�8�URRU5$)z5Determine the tree path associated with the trans_id.)r[�getrws  r!�	tree_path�TreeTransform.tree_pathJs���"�"�&�&�x�0�0r$c�,�[UR5er)ru�final_is_versionedrws  r!r�� TreeTransform.final_is_versionedNs��!�$�"9�"9�:�:r$c�d�URU$![a URU5s$f=f)ziDetermine the parent file_id, after any changes are applied.

ROOT_PARENT is returned for the tree root.
)r]�KeyErrorr�rws  r!r��TreeTransform.final_parentQs8��
	2��#�#�H�-�-���	2��'�'��1�1�	2�s��/�/c���URU$![aI [RR	UR
U5s$![a [
X5ef=ff=f)z<Determine the final filename, after all changes are applied.)r\r�r�r{�basenamer[rrws  r!�
final_name�TreeTransform.final_name[sd��	2��>�>�(�+�+���	2�
2��w�w�'�'��(;�(;�H�(E�F�F���
2�!�(�1�1�
2��	2�s ��
A$�+A
�A$�
A � A$c�H�XR;=(d XR;$)z-Return True if a trans_id's path has changed.)r\r]rws  r!�path_changed�TreeTransform.path_changedes���N�N�*�M��<L�<L�0L�Mr$c��XR;$r)r^rws  r!�new_contents�TreeTransform.new_contentsis���-�-�-�-r$c�,�[UR5e)z:Find any violations of inventory or filesystem invariants.)ru�find_raw_conflictsrjs r!r�� TreeTransform.find_raw_conflictsls��!�$�"9�"9�:�:r$c�,�[UR5e)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.
)ru�new_file)rr�r��contentsr��
executable�sha1s       r!r��TreeTransform.new_fileps��"�$�-�-�0�0r$c�,�[UR5e)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.
)ru�
new_directory)rr�r�r�s    r!r��TreeTransform.new_directory~s��"�$�"4�"4�5�5r$c�,�[UR5e)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.
)ru�new_symlink)rr�r��targetr�s     r!r��TreeTransform.new_symlink�s��"�$�"2�"2�3�3r$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.
)ru�
new_orphan)rrr�s   r!r��TreeTransform.new_orphan�s��"�$�/�/�2�2r$c�,�[UR5e)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.
)ru�iter_changesrjs r!r��TreeTransform.iter_changes�s��"�$�"3�"3�4�4r$c�,�[UR5e)z�Return a tree representing the result of the transform.

The tree is a snapshot, and altering the TreeTransform will invalidate
it.
)ru�get_preview_treerjs r!r�TreeTransform.get_preview_tree�s��"�$�"7�"7�8�8r$c�,�[UR5e)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.
)ru�commit)r�branch�message�
merge_parents�strict�	timestamp�timezone�	committer�authors�revpropsr�s           r!r�TreeTransform.commit�s��B"�$�+�+�.�.r$c�,�[UR5e)aSchedule 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.
)ru�create_file)rr�r�mode_idr�s     r!r�TreeTransform.create_file�s��"�$�"2�"2�3�3r$c�,�[UR5e)z?Schedule creation of a new directory.

See also new_directory.
)ru�create_directoryrws  r!r�TreeTransform.create_directory�s��
"�$�"7�"7�8�8r$c�,�[UR5e)zYSchedule creation of a new symbolic link.

target is a bytestring.
See also new_symlink.
)ru�create_symlink)rr�rs   r!r�TreeTransform.create_symlink�s��"�$�"5�"5�6�6r$c�,�[UR5er)ru�create_tree_reference)r�reference_revisionrs   r!r�#TreeTransform.create_tree_reference�s��!�$�"<�"<�=�=r$c�,�[UR5e)z!Schedule creation of a hard link.)ru�create_hardlink�rr{rs   r!r�TreeTransform.create_hardlink����!�$�"6�"6�7�7r$c�,�[UR5e)z)Cancel the creation of new file contents.)ru�cancel_creationrws  r!r"�TreeTransform.cancel_creation�r r$c�,�[UR5e)zCook conflicts.)ru�cook_conflicts)r�
raw_conflictss  r!r%�TreeTransform.cook_conflicts�s��!�$�"5�"5�6�6r$)
rdrYr^rar\r]rbrXr`rcrWr[rZr)F)NNN)NFNNNNNN�NN)4r&r'r(r)�__doc__r"rkrrrvr|rr�rnr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr"r%r+r,r$r!rTrTbs��"�H�4��;��2��1��,�	9�8��)�>�1�0�&�
I�H�5�:�'�2�,� 1�;�2�2�N�.�;�
NR�1�6�4�	3�
5�9���������!/�F4� 9�7�>�8�8�7r$rTc�"�\rSrSrSrSrSrSrg)�OrphaningErroriTz(Error while orphaning %s in %s directoryc�Z�[RRU5 XlX lgr)rrr"�orphanr�)rr-r�s   r!r"�OrphaningError.__init__s����� � ��&����r$)r-r�N)r&r'r(r)�internal_errorr*r"r+r,r$r!r+r+s���N�5�D�r$r+c��\rSrSrSrSrSrg)�OrphaningForbiddeniz*Policy: %s doesn't allow creating orphans.c�N�[RRU5 Xlgr)rrr"�policy)rr3s  r!r"�OrphaningForbidden.__init__s����� � ��&��r$)r3Nr%r,r$r!r1r1s��7�D�r$r1c�T�SnURU5nURU5cURU5 URUnUR	U5nURXd5nUR
XtU5 [R"SR[XV5U55 g)aSee TreeTransformBase.new_orphan.

This creates a new orphan in the `brz-orphans` dir at the root of the
`TreeTransform`.

:param tt: The TreeTransform orphaning `trans_id`.

:param orphan_id: The trans id that should be orphaned.

:param parent_id: The orphan parent trans id.
zbrz-orphansNz{} has been orphaned in {})r�r�rr[r��_available_backup_namer�r�warningr��joinpath)�tt�	orphan_idr��orphan_dir_basename�od_id�parent_path�actual_name�new_names        r!�move_orphanr@s���(���!�!�"5�6�E�	�}�}�U��#�
���E�"��#�#�I�.�K��-�-�	�*�K��(�(��<�H��N�N�8�I�.�	�M�M�$�+�+��[�.�0C�	
�r$c��[S5e)zjSee TreeTransformBase.new_orphan.

This refuses to create orphan, letting the caller handle the conflict.
�never)r1)r9r:r�s   r!�
refuse_orphanrC3s��
�W�
%�%r$�conflictz>Leave orphans in place and create a conflict on the directory.�movez,Move orphans into the brz-orphans directory.ztransform.orphan_policyz6Policy for orphaned files during transform operations.r7)�help�invalidc�.�UbUS:XaU$[X5$)z;Join tree-relative paths, handling the tree root specially.r�)r)r��childs  r!r8r8Qs��
�~��2������&�&r$c�0�\rSrSrSrSrSrSrSrSr	g)	�
FinalPathsiYz�Make path calculation cheap by memoizing paths.

The underlying tree must not be manipulated between calls, or else
the results will likely be incorrect.
c�H�[RU5 0UlXlgr)rOr"�_known_pathsr �rr s  r!r"�FinalPaths.__init__`s����������"�r$c�"�XRR:Xd
U[:XagURRU5nURR	U5nX0RR:XaU$[UR
U5U5$)Nr�)r rr�r�r�r�get_path)rrr�r�s    r!�_determine_path�FinalPaths._determine_patheso���~�~�*�*�*�h�+�.E���~�~�(�(��2���N�N�/�/��9�	����+�+�+��K��D�M�M�)�4�d�;�;r$c�z�XR;aURU5URU'URU$)z/Find the final path associated with a trans_id.)rMrRrws  r!rQ�FinalPaths.get_pathos:���,�,�,�*.�*>�*>�x�*H�D���h�'�� � ��*�*r$c�R�UVs/sHo RU5U4PM sn$s snfr)rQ)r�	trans_idsr�s   r!�	get_paths�FinalPaths.get_pathsus&��/8�9�y�!���q�!�1�%�y�9�9��9s�$)rMr N)
r&r'r(r)r)r"rRrQrXr+r,r$r!rKrKYs���#�
<�+�:r$rKc�v�URU5H$nURURU5X#5 M& gr)rvr�r�)r9�
old_parent�
new_parentrIs    r!�_reparent_childrenr]ys.���&�&�z�2��
���r�}�}�U�+�Z�?�3r$c��UR5nX1H$nURURU5X$5 M& X1$r)r�r�r�)r9r[r\r�rIs     r!�_reparent_transform_childrenr_~s:������I��&��
���r�}�}�U�+�Z�?�'�� � r$c�:�URnURnUS:Xa^URU5nURU5nUR	XS[
R"U5URU5sSSS5 $US;a@URXSUR5n	US:XaURURU	5 U	$US:Xa-URU5n
URXSX�R5$[R"XV5e!,(df   g=f)z3Create a new file according to its inventory entry.�fileN��	directoryr�r��symlink)r�r��get_file�
is_executabler�r	�
file_iteratorr�r�r�r�get_symlink_targetr�r�BadFileKindError)r{r9�entryr�rer�r��fr�rr�s           r!�new_by_entryrl�s����:�:�D��:�:�D��v�~�
�]�]�4�
 �A��+�+�D�1�J��;�;���!6�!6�q�!9�5�=�=�*��!�
 �

�0�	0��#�#�D�U�]�]�C���#�#��!�!�%�":�":�H�E���	
��	��(�(��.���~�~�d�v�}�}�E�E��%�%�d�1�1�!�
 �s�AD�
Dc��URU5nUS:XaURU5 gUS:Xa�Uc(URU5n[R"U5nOSnUR
nUR
5(a)Ub&URU5n	[XI[XR55nURXA5 UbUR5 ggUS:Xa"URURU5U5 gUS:Xa"URURU5U5 g[!SR#U55e!UbUR5 ff=f)z�Create new file contents according to tree contents.

:param filter_tree_path: the tree path to use to lookup
  content filters to apply to the bytes output in the working tree.
  This only applies if the working tree supports content filtering.
rcraNrdr�zUnknown kind {!r})r�rrer	rgrW�supports_content_filtering�_content_filter_stackrrr�closerrhr�get_reference_revision�AssertionErrorr�)
r9rrer{�chunks�filter_tree_pathr�rk�wt�filterss
          r!�create_from_treerw�s6���9�9�T�?�D��{��
���H�%�	
����>��
�
�d�#�A��*�*�1�-�F��A�
	����B��,�,�.�.�3C�3O��2�2�3C�D��.��%9�:J�%Q���
�N�N�6�,��}����	��	
��	�
���$�1�1�$�7��B�	
�!�	!�
� � ��!<�!<�T�!B�H�M��0�7�7��=�>�>���}����	��s
�AD8�8Ec�^�URS:XaURURU5 gg)zDSet the executability of a trans_id according to an inventory entry.raN)r�r�r�)r9rjrs   r!�create_entry_executabilityry�s)���z�z�V��
���U�-�-�x�8�r$c	�x^�[RR5n	UcUR5n[	UUTUU	UUUU5	nSSS5 [RR5n	[X9U4Sj5n
SSS5 UR
W
5nX�4$!,(df   NY=f!,(df   N3=f)Nc�>�[XT5$r)�
conflict_pass)r��c�target_trees  �r!�<lambda>�+_prepare_revert_transform.<locals>.<lambda>�s���}�Q�;�'Gr$)�ui�
ui_factory�nested_progress_bar�merge_modified�_alter_files�resolve_conflictsr%)�es�working_treer~r9�	filenames�backups�pp�
basis_treer��child_pbr&�	conflictss  `         r!�_prepare_revert_transformr��s����
���	*�	*�	,���!�)�8�8�:�N�%����������

��
-�
���	*�	*�	,��)��G�
�
�
-��!�!�-�0�I��$�$�'
-�	,��
-�	,�s�'B�-B+�
B(�+
B9c
���[R"5nUR[RR55nURUR
55 URURU55n	[SSU5n
[X�XX#U
5up�U(a?SSK
Jn URURS9nURU	R5U5 UH"n
[ R""[%U
55 M$ U
R'5 U	R)5 UR+5(aUR-U5 SSS5 U$!,(df   W$=f)z;Revert a working tree's contents to those of a target tree.zRevert phase�r)�delta)�unversioned_filterN)�
contextlib�	ExitStack�
enter_contextr�r�r��	lock_readr rr�r�r��_ChangeReporter�
is_ignored�report_changesr�rr7�str�
next_phase�apply�supports_merge_modified�set_merge_modified)r�r~r�r�rf�change_reporterr�r�r�r9r�r�r�rDs              r!�revertr��s+��
�	�	�	�2�
�
�
�b�m�m�?�?�A�
B��
����.�.�0�1�
�
�
�l�4�4�R�8�
9��
�>�1�b�
1��$=��k�y�2�%
�!�	���#�3�3�#/�#:�#:�4��O�
� � ����!2�O�D�!�H��M�M�#�h�-�(�"�
�
�
��
���
��/�/�1�1��+�+�N�;�)
 �*��+
 �	�*��s�D>E�
E-c		�
�UbURUR55 URX%US9n	URS5(dSn
OSn
/n[	U	5GH7up�U
R
up�U
RunnU
RunnU
RunnU
RunnU
(aUS:XaM_SnUbURU5nOUR5nU
R(Ga�SnUS:Xa�U(dUc�URU5nURU5U:wa�Uc/UR5nURUR55 [ R"X�5nUR#U5nUc
Uc	U(dSnOUURU5:waSnUb�U(dUR%U5 O�Ub�UR[&R("U55nUR+UU5nUR-UUU5 UR/UU5n U(a3U(a,UR1U5 UR3U [5U
SS5S9 UnU nUS;a<UR7U5 US	:Xa#UR9U5n!UR;U!U5 GOUS
:Xa"UR=UR?U5U5 O�US:Xa�URAUUUU445 Uc/UR5nURUR55 URU5n"[ R"X�5nUR#U5nUbU"URU5:Xa
UU;aUU	OU"X~'U(aUU:XaURCUU5 OUb[EU5eU(d"U(aUR3U[5U
SS5S9 U(aU(dUR1U5 Ub{UU:wdU
RG5(a`US:Xa[Hn#O U
RJSn$URMU$5n#US:XaU(aUROUU#5 OUR-UU#U5 UU:wdGMUS:XdGM%URCUU5 GM: URQ5(aZURSU5HDuunnnn%URUU5n&[WU%U&[YX�55n%UR[U%UU5 MF O2URSU5Huunnnn%UR[U%UU5 M UR]5 U$)N)�specific_filesrfr�TFrar��r�rbr�rdr)/r�r�r��is_versioned�	enumerater{�	versionedr�r�r�r�r��changed_content�
get_file_sha1r�r�r�find_source_pathr�r	r�r6r�r�r�r��getattrrrqr�rrh�appendr�rr�
is_reparentedr�r��trans_id_file_idr�rn�iter_files_bytesrorrrr�)'r�r�r~r9rfr�r�r�r��change_list�	skip_root�deferred_files�_id_num�change�target_path�wt_path�target_versioned�wt_versioned�target_name�wt_name�target_kind�wt_kind�target_executable�
wt_executablerr�keep_content�wt_sha1�basis_inter�
basis_path�parent_trans_id�backup_name�new_trans_id�revision�new_sha1�parent_trans�
target_parent�bytesrvs'                                       r!r�r�s����
����-�-�/�0�
�+�+��r�,��K��#�#�B�'�'��	��	��N�$�[�1���%�{�{���)/�)9�)9�&��,�%�{�{���W�%�{�{���W�+1�+<�+<�(��=���B��������,�,�W�5�H��|�|�~�H��!�!�!� �L��&� �g��1D�&�4�4�W�=��!�%�%�g�.�'�9�"�)�%1�%<�%<�%>�
��(�(��)=�)=�)?�@�"+�-�-�
�"I�K�!,�!=�!=�g�!F�J�!�)�&�.�7G�+/�L��"�j�&>�&>�z�&J�J�+/�L��"�#��&�&�x�0� �,�&(�&;�&;�G�O�O�G�<T�&U�O�"$�";�";�G�_�"U�K��N�N�;���J�#%�>�>�'�?�#K�L�#�(8��)�)�(�3����(�'�&�)�T�2R�(��
'�G�+�H��=�=��#�#�H�-��"2�2�*�A�A�+�N�H��)�)�(�H�=���	�)��!�!�+�"@�"@��"M�x�X���&��%�%�{�X�w��4T�&U�V��%�!-�!8�!8�!:�J��$�$�Z�%9�%9�%;�<�&�4�4�[�A��'�m�m�J�D��(�9�9�+�F�
��)�h�*�:R�:R��;�/�
"�^�3�*�:�6��2:�N�/� �M�5F�$F��(�(�):�H�E���(�$�[�1�1�� 0��O�O�H�g�f�i��.N�O�O�� 0����h�'��"��{�"�f�&:�&:�&<�&<��b� �*�� &� 0� 0�� 3�
�!�2�2�=�A���"�}���#�#�K��>����{�L�(�C��-�-�+��2G�� � �!2�H�=�A2�B�.�.�0�0�7B�7S�7S��8
�3�,�X�w��e�#�8�8��E�G�)��w� 4�[� O��E�
�N�N�5�(�G�4�8
�8C�7S�7S��8
�3�,�X�w��e�
�N�N�5�(�G�4�8
������r$c��Uc[n[5n[RR	5n[S5HenUR
[S5US-S5 UR5n[U5S:Xa
Us sSSS5 $UR
U"X55 Mg [WS9e!,(df   g=f)z=Make many conflict-resolution attempts, but die if they fail.N�
zResolution passrr)r�)r|r_r�r�r��range�update�gettextr��lenr2)r9rf�	pass_func�
new_conflicts�nr�s      r!r�r��s�����!�	��E�M�	���	*�	*�	,���r��A��I�I�g�/�0�!�a�%��<��-�-�/�I��9�~��"�$�$�
-�	,�
� � ��2�!9�:��!�9�5�5�
-�	,�s�AB0�$B0�0
B>c#�<# �URU5 USX44v� g7f)NzUnversioned existing file)r�)r9�	path_tree�c_type�old_trans_idrs     r!�resolve_duplicate_idr��s!������l�#��.��
G�G�s�c#��# �URU5nURU5(aXCp�OX4p�URR5(djUR	U5S:XaUUR	U5S:Xa@[XU5 UR
U5 URU5 URU5 gURU5S-n	URX�U5 USXx4v� g7f)Nrcz.movedzMoved existing file to)r�r�rW�has_versioned_directoriesr�r_r�r�r"r�r�)
r9r�r��
last_trans_idrr�r��
existing_filer�r?s
          r!�resolve_duplicater��s�����?�?�=�1�L�	���}�%�%�"*�x�"/�x��H�H�.�.�0�0��M�M�(�#�{�2��M�M�-�(�K�7�$�R��A�
���=�)�
���-�(�
���=�)��=�=��/�(�:��
���x�}�=��/��I�I�s�C$C&c#�# �URU5(d)URU5nURU5(dM)USUURU54v� URURU5UR	U5U5 g7f)NzCancelled move)r�r�r�r�r�)r9r�r��curs    r!�resolve_parent_loopr��sz����o�o�c�"�"��o�o�c�"���o�o�c�"�"�	���
�����	���N�N�2�=�=��%�r�'9�'9�#�'>��D�s�>B�A	Bc#�# �X0R;aXSnURU5nU(aSnUHnURXc5 M U(aUR	U5 SSU4v� ggSnURU5 U(aUR%U5 USU4v� gg![a Sn Mff=f![a� Ub�URU5nUcURU5n[URURU5/S95up�U
Rc*Sn[XUR5nUH
nUSU4v� M N�URU
R5n
UR!U
R"X�5 GNf=f7f)NTFzdeleting parentzNot deleting)r�z
Moved to root�Created directory)r`�_get_potential_orphansr�r+r�r�r�
final_file_id�inactive_file_id�next�iter_entries_by_dir�id2pathr�r_rr�r�r�r)r9r�r�rr��orphans�o�creater��_rj�movedrIr�s              r!�resolve_missing_parentr��s�����'�'�'����+�+�H�5���#�O���
��M�M�!�.������x�(�$�n�h�?�?��
��	J��M�M�(�#�*�����)��.��9�9���K&��'+�O����"�	J��$��*�*�8�4���?� �1�1�(�;�G���1�1�(1�(9�(9�'�(B�'C�2������?�?�*�"�F�8��r�w�w�O�E�!&��%���>�>�"'�')�&9�&9�%�/�/�&J�O��N�N�5�:�:��I��'	J�sY�1F�B�'F�-B3�>!F�B0�+F�/B0�0F�3BF�F�7F�=F�F�Fc#�# �URU5nU(aURS5U:XagURX4S9 USU4v� g7f)Nr�r�zVersioned directory)r��path2idr�)r9r�r�rr�s     r!�resolve_unversioned_parentr�sI����!�!�(�+�G��Y�&�&�r�*�g�5���O�O�H�O�.��(�(�
3�3�s�AAc#�.# �URU5nURU5nURR5(aUR	U5nOSnURUS-XF5n[
XU5 UbURU5 USU4v� g7f)NsDUMMYz.newr�)r�r�rW�supports_setting_file_idsr�r�r_r�)r9r�r�r��
parent_parent�parent_name�parent_file_id�
new_parent_ids        r!�resolve_non_directory_parentr�s�����O�O�I�.�M��-�-�	�*�K�	�x�x�)�)�+�+��)�)�)�4��!���$�$��f��m��M�!��
�>��!�
���)�$��&�
�
6�6�s�BBc�(�URU5 /$r)r�)r9r�r�rs    r!�resolve_versioning_no_contentsr�s������"�
�Ir$)zduplicate id�	duplicatezparent loopzmissing parentzunversioned parentznon-directory parentzversioning no contentsc��[5nUH8n[RUS5nUcM URU"X/UQ765 M: U$)z�Resolve some classes of conflicts.

:param tt: The transform to resolve conflicts in
:param conflicts: The conflicts to resolve
:param path_tree: A Tree to get supplemental paths from
r)r_�CONFLICT_RESOLVERSr�r�)r9r�r�r�rD�resolvers      r!r|r|-sR���E�M���%�)�)�(�1�+�6��������X�b�?�h�?�@�	�
�r$c�6�\rSrSrSrSrSrSrSrSr	Sr
g	)
�
_FileMoveri=z?Moves and deletes files for TreeTransform, tracking operations.c� �/Ul/Ulgr��past_renames�pending_deletionsrjs r!r"�_FileMover.__init__@s�����!#��r$c�T�[R"X5 URRX45 g![ahnUR[R[R
4;a[
U[U55e[X[U5UR5eSnAff=f)z'Rename a file from one path to another.N)r��rename�OSErrorrD�EEXIST�	ENOTEMPTYrr�r>rr��r�from_�to�es    r!r�_FileMover.renameDs���	D��I�I�e� �	
��� � �%��-��
�	D��w�w�5�<�<����9�9� ��S��V�,�,�(��3�q�6�1�7�7�C�C��	D�s�5�
B'�A#B"�"B'c�\�URX5 URRU5 g)z�Rename a file out of the way and mark it for deletion.

Unlike os.unlink, this works equally well for files and directories.
:param from_: The current file path
:param to: A temporary path for the file
N)rrr�)rrr
s   r!�
pre_delete�_FileMover.pre_deletePs$��	
���E�����%�%�b�)r$c	���[UR5Hup[R"X!5 M SUlSUlg![a%n[X![
U5UR5eSnAff=f)z-Reverse all renames that have been performed.N)	�reversedrr�rrr>r�rDrrs    r!�rollback�_FileMover.rollbackZsh��!�$�"3�"3�4�I�E�
H��	�	�"�$�5�!���!%����	�
H�+�B�s�1�v�q�w�w�G�G��
H�s�A�
A4� A/�/A4c�\�URHn[U5 M SUlSUlg)zApply all marked deletions.N)rrrrzs  r!�apply_deletions�_FileMover.apply_deletionses,���*�*�D��t��+�!���!%��r$rN)r&r'r(r)r)r"rrrrr+r,r$r!rr=s��I�$�
.�*�	&�&r$rc���UR5nURUSS9H�nUR(aMURS:waM(URSURS:waMJURURS5nURU5 URURURS5U5 M� UR5 SSS5 g!,(df   g=f)z�Where possible, hard-link files in a tree to those in another tree.

:param target_tree: Tree to change
:param source_tree: Tree to hard-link from
T)�include_unchanged)rararrN)r r�r�r�r�r�r{r�r�abspathr�)r~�source_treer9r�rs     r!�	link_treerns���
�	�	�	 �B�!�.�.�{�d�.�S�F��%�%���{�{�.�.��� � ��#�v�'8�'8��';�;���,�,�V�[�[��^�<�H����x�(����{�2�2�6�;�;�q�>�B�H�M�T�	���
�
!�	 �	 �s�CC&�&
C4c��\rSrSrSrSrSrSr\S5r	Sr
SrS	rS
r
SrSrS
rSrSrSrSrSSjrSSjrSrSrSrSrSrSrSrSrg)�PreviewTreei�z
Preview tree.c�V�Xl/UlSUl0Ul0Ul0Ulgr)�
_transform�_parent_ids�_PreviewTree__by_parent�_path2trans_id_cache�_all_children_cache�_final_name_cacherNs  r!r"�PreviewTree.__init__�s/��#��������$&��!�#%�� �!#��r$c�,�[UR5er)rur�rjs r!r��%PreviewTree.supports_setting_file_ids�s��!�$�"@�"@�A�Ar$c�J�URRR5$r)r"rW�supports_symlinksrjs r!r,�PreviewTree.supports_symlinks�s�����$�$�6�6�8�8r$c�r�URcURR5UlUR$r)r$r"r�rjs r!�
_by_parent�PreviewTree._by_parent�s/�����#�#���8�8�:�D�����r$c��UR$r�r#rjs r!�get_parent_ids�PreviewTree.get_parent_ids�s�����r$c��Xlgrr2)r�
parent_idss  r!�set_parent_ids�PreviewTree.set_parent_ids�s��%�r$c�L�URRRU5$r)r"rW�get_revision_tree�rr�s  r!r:�PreviewTree.get_revision_tree�s�����$�$�6�6�{�C�Cr$c��g�NFr,rjs r!�	is_locked�PreviewTree.is_locked�s��r$c�B�[R"UR5$r)r�LogicalLockResult�unlockrjs r!r��PreviewTree.lock_read�s���%�%�d�k�k�2�2r$c��grr,rjs r!rC�PreviewTree.unlock�s��r$c���URRU[5nU[LaU$[R"U5nUR
RnUH{nURU5HTnURRU5nUc)UR
RU5nXpRU'Xu:XdMQUn Mj SURU' g X@RU'U$)z�Look up the trans id associated with a path.

:param path: path to look up, None when the path does not exist
:return: trans_id
N)
r%r�rOr	�	splitpathr"r�
_all_childrenr'r�)rr{r�segments�
cur_parent�cur_segmentrIr�s        r!�_path2trans_id�PreviewTree._path2trans_id�s����,�,�0�0��v�>���6�!��O��$�$�T�*���_�_�)�)�
�#�K��+�+�J�7��!�3�3�7�7��>�
��%�!%���!;�!;�E�!B�J�4>�*�*�5�1��,�!&�J��8�37��)�)�$�/��$�+5�!�!�$�'��r$c�J�URRU5nUbU$[URR	U55nURURR5 URURRU/55 X RU'U$r)	r&r�r_r"rv�difference_updater]r�r/)rr�childrens   r!rI�PreviewTree._all_children�s����+�+�/�/��9�����O��t���9�9�(�C�D���"�"�4�?�?�#>�#>�?�������+�+�H�b�9�:�-5� � ��*��r$c�(�URU5S4$r)rerzs  r!�get_file_with_stat�PreviewTree.get_file_with_stat�s���}�}�T�"�D�(�(r$c�R�URU5nUcgURRU$![al URRRU5s$![a*nUR[R:XaSnAgeSnAf[a gf=ff=fr>)
rMr"rar�rWrfrrD�ENOENTr)rr{rrs    r!rf�PreviewTree.is_executable�s����&�&�t�,�����
	��?�?�5�5�h�?�?���	�
����,�,�:�:�4�@�@���
��7�7�e�l�l�*� ����
��
��	�sD�0�
B&�$A"�B&�"
B"�,B�
B&�B�
B"�B&�!B"�"B&c���URU5nX RR;agX RR;agURRRU5$)NTF)rMr"r^r`rW�has_filenamers   r!rZ�PreviewTree.has_filename�sS���&�&�t�,�����4�4�4��
���:�:�
:���?�?�(�(�5�5�d�;�;r$Nc�l�URU5nUc[U5eURRR	U5nUc%URR
R
U5$US:Xa1URU5n[R"U5sSSS5 $g!,(df   g=f)Nra)
rMrr"r^r�rWr�rer	�sha_file�rr{�
stat_valuerr��fileobjs      r!r��PreviewTree.get_file_sha1�s����&�&�t�,�����T�"�"����,�,�0�0��:���<��?�?�(�(�6�6�t�<�<��6�>����t�$���'�'��0�%�$��$�$�s�B%�%
B3c�p�URU5nUc[U5eURRR	U5nUc%URR
R
U5$US:Xa3URU5nS[R"U54sSSS5 $g!,(df   g=f)Nra�SHA1)
rMrr"r^r�rW�get_file_verifierrer	r]r^s      r!rd�PreviewTree.get_file_verifier�s����&�&�t�,�����T�"�"����,�,�0�0��:���<��?�?�(�(�:�:�4�@�@��6�>����t�$���� 0� 0�� 9�:�%�$��$�$�s�B'�'
B5c�v�URU5nUc[U5eURRU5$r)rMrr"r�rs   r!r��PreviewTree.kinds8���&�&�t�,�����T�"�"����)�)�(�3�3r$c���URU5nUc[U5eURRU$![a( URR
R
U5s$f=fr)rMrr"r^r�rW�stored_kindrs   r!ri�PreviewTree.stored_kind
sg���&�&�t�,�����T�"�"�	;��?�?�0�0��:�:���	;��?�?�(�(�4�4�T�:�:�	;�s�:�/A,�+A,c��[URRSS5nUc*URRRRnU$)N�_repository)r�r"rWr�
repository)r�repos  r!�_get_repository�PreviewTree._get_repositorys?���t���,�,�m�T�B���<��?�?�(�(�/�/�:�:�D��r$c#��# �UR5HnURU5v� M g![Ra% UR	5RU5v� MTf=f7fr)r3�
revision_treer�NoSuchRevisionInTreeror;s  r!�_iter_parent_trees�PreviewTree._iter_parent_treessa����.�.�0�K�
H��(�(��5�5�1���.�.�
H��*�*�,�:�:�;�G�G�
H�s%�A+�/�A+�5A(�$A+�'A(�(A+c�b�URU5nUc[U5eURRU5nUS:wagX RR;aURU5R$URU5S:Xa%URRRU5$g)zSee Tree.get_file_size.Nra)
rMrr"r�r^�_stat_limbo_file�st_sizer�rW�
get_file_size)rr{rr�s    r!ry�PreviewTree.get_file_size s����&�&�t�,�����T�"�"����)�)�(�3���6�>�����4�4�4��(�(��2�:�:�:��9�9�T�?�f�$��?�?�(�(�6�6�t�<�<�r$c���URU5nUc[U5eURRR	U5nUc%URR
R
U5$U$r)rMrr"rbr�rWrq)rr{rrs    r!rq�"PreviewTree.get_reference_revision/se���&�&�t�,�����T�"�"�!�_�_�D�D�H�H��R���%��?�?�(�(�?�?��E�E�!�!r$c��URRU5nUcgURRU5SnUS:XaSnU$)Nr�missing)r[r�rW�path_content_summary)rrr{r�s    r!r�PreviewTree.tree_kind8sK���"�"�&�&�x�0���<���z�z�.�.�t�4�Q�7���9���D��r$)�__by_parentr&r'r#r%r"r)r&r'r(r)r)r"r�r,�propertyr/r3r7r:r?r�rCrMrIrTrfrZr�rdr�rirortryrqrr+r,r$r!r r �s����$�B�9�� �� �
 �&�D��3�
��6	�)�� <�	1�	;�4�;��H�
�"�r$r r()NFNNNNr)Kr�rDr��typingrr�r�_mod_configrrrr	r
r�globalsrr
rrvrrrr�progressr�	transportrrrerr�rr.r2r5r8r>rJrLrTr+r1r@rC�Registryr�r��orphaning_registry�register�_set_default_key�RegistryOption�opt_transform_orphanr8rKr]r_rlrwryr�r�r�r�r�r�r�r�r�r�r�r�r|rrr r,r$r!�<module>r�s;��"��	��#�A�A�����I���=�<�@�)�#�-����,�(�,�I�x�I�7�)�7�E�8�E�#�H�#��H���)�)�^7�^7�B
�V�_�_������:&��&�&���=�%��/��5�	6�6���������D��
���
�K�G���#�#�J�/�#�1�1���	A��	��'�:�:�@@�
!�2�, ?�F9���%�H������ �X�L�^6�H�
J�,
E�1:�h4�7�"�)�"�&�,�4�8�<���
� .&�.&�b�(}�}r$

Youez - 2016 - github.com/yon3zu
LinuXploit