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__/diff.cpython-313.pyc
�

p��g���
�j�SSKrSSKrSSKrSSKrSSKrSSKJrJr SSKJr \"\	"5S5 SSK
JrJr SSK
J
r SSKJr SS	KJrJrJr SS
KJrJr Sr"SS
\R25rSSS\4SjrS2SjrS3Sjr/SQrSrSr S3Sjr!S4Sjr"SSSSSSSS\4	S\#S\#S\#S\\#4Sjjr$Sr%S r&"S!S"5r'"S#S$5r("S%S&\'5r)"S'S(\'5r*"S)S*\'5r+"S+S,\'5r,"S-S.\'5r-"S/S05r.\\#\/\.4"5r0\0RcS1\.5 g)5�N)�Optional�Union�)�lazy_importz�
import errno
import patiencediff
import subprocess

from breezy import (
    controldir,
    textfile,
    timestamp,
    views,
    )

from breezy.workingtree import WorkingTree
from breezy.i18n import gettext
)�errors�osutils)�	transport)�Registry)�mutter�note�warning)�FileTimestampUnavailable�Tree�c��\rSrSrSrSrSrg)�_PrematchedMatcher�;z=Allow SequenceMatcher operations to use predetermined blocks.c�N�[R"USS5 XlSUlg�N)�difflib�SequenceMatcher�matching_blocks�opcodes)�selfrs  �-/usr/lib/python3/dist-packages/breezy/diff.py�__init__�_PrematchedMatcher.__init__>s!������d�D�1�.�����)rrN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�rrrr;s
��G�rrF�utf8c		�@�USLa*[RU5 [RU5 Uc[Rn[	UUURUS5URUS5UUS9n	[
U	5n	[U	5S:XagU(dU	SRSS5U	S'OU(dU	SRSS	5U	S'U	H=n
URU
5 U
RS
5(aM,URS5 M? URS
5 g)NF�replace)�fromfile�tofile�n�sequencematcherr�s-1,0s-0,0s+1,0s+0,0�
s
\ No newline at end of file
)�textfile�check_text_lines�patiencediff�PatienceSequenceMatcher�unified_diff_bytes�encode�list�lenr(�write�endswith)�	old_label�oldlines�	new_label�newlines�to_file�allow_binary�sequence_matcher�
path_encoding�
context_lines�ud�lines           r�
internal_diffrDDs��*�u���!�!�(�+��!�!�(�+���'�?�?��	����!�!�-��;����
�y�9�
�(�

�B�
�b��B�
�2�w�!�|����1��
�
�g�w�/��1��
��1��
�
�g�w�/��1�����
�
�d���}�}�U�#�#��M�M�=�>���M�M�%�rc	#�6# �Uc[RnU(aS[U5-nU(aS[U5-nSn	U"SX5RU5H�n
U	(dSX$U4-v� SX5U4-v� Sn	U
SSU
S	S
U
SSU
S	S4up�p�S
US-X�-
U
S-X�-
U4-v� U
H_up�p�nUS:XaXUH
nSU-v� M M!US:XdUS:XaXUH
nSU-v� M US:XdUS:XdMMXUH
nSU-v� M Ma M� g7f)aCompare two sequences of lines; generate the delta as a unified diff.

Unified diffs are a compact way of showing line changes and a few
lines of context.  The number of context lines is set by 'n' which
defaults to three.

By default, the diff control lines (those with ---, +++, or @@) are
created with a trailing newline.  This is helpful so that inputs
created from file.readlines() result in diffs that are suitable for
file.writelines() since both the inputs and outputs have trailing
newlines.

For inputs that do not have trailing newlines, set the lineterm
argument to "" so that the output will be uniformly newline free.

The unidiff format normally has a header for filenames and modification
times.  Any or all of these may be specified using strings for
'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.  The modification
times are normally expressed in the format returned by time.ctime().

Example:
>>> for line in bytes_unified_diff(b'one two three four'.split(),
...             b'zero one tree four'.split(), b'Original', b'Current',
...             b'Sat Jan 26 23:30:50 1991', b'Fri Jun 06 10:20:52 2003',
...             lineterm=b''):
...     print line
--- Original Sat Jan 26 23:30:50 1991
+++ Current Fri Jun 06 10:20:52 2003
@@ -1,4 +1,4 @@
+zero
 one
-two
-three
+tree
 four
N�	Fs
--- %s%s%ss
+++ %s%s%sTrr���r-r�s@@ -%d,%d +%d,%d @@%s�equal� r(�delete�-�insert�+)rr�bytes�get_grouped_opcodes)�a�br)r*�fromfiledate�
tofiledater+�linetermr,�started�group�i1�i2�j1�j2�tagrCs                 rr3r3ysZ���^��!�1�1����u�\�2�2����U�:�.�.�
��G� ��q�,�@�@��C����8�8�"D�D�D��6�x�"@�@�@��G��q��!��e�B�i��l�E�!�H�Q�K��r��1��M����&�"�q�&�"�'�2��6�2�7�H�)U�U�U�#(��C�R�R��g�~���H�D���+�%�%���i��3�(�?���H�D���+�%�%��i��3�(�?���H�D���+�%�%�$)�D�s�C8D�>Dc��U(aH0n[RRS5nUbX2S'SUS'SUS'SUS'[RnOSnSn[RU[R[RUUS9nU$![aCnUR[R:Xa[R"[U55eeSnAff=f)a(Spawn the external diff process, and return the child handle.

:param diffcmd: The command list to spawn
:param capture_errors: Capture stderr as well as setting LANG=C
    and LC_ALL=C. This lets us read and understand the output of diff,
    and respond to any errors.
:return: A Popen object.
�PATHN�C�LANGUAGE�LANG�LC_ALL)�stdin�stdout�stderr�env)�os�environ�get�
subprocess�PIPE�Popen�OSError�errno�ENOENTr�NoDiff�str)�diffcmd�capture_errorsrf�pathre�pipe�es       r�_spawn_external_diffrw�s�������z�z�~�~�f�%������K���J����F����H�
���������������/�/��?�?��� �
���K�����7�7�e�l�l�"��-�-��A��'�'�
���s�3B
�

C�>C�C)z-cz-Cz	--contextz-ez--edz-fz--forward-edz-qz--briefz--normalz-nz--rcs�-uz-Uz	--unifiedz-yz--side-by-sidez-Dz--ifdefc��[H'nUHnURU5(dM O M& U$ URS5 U$)a�Default to unified diff style if alternative not specified in diff_opts.

    diff only allows one style to be specified; they don't override.
    Note that some of these take optargs, and the optargs can be
    directly appended to the options.
    This is only an approximate parser; it doesn't properly understand
    the grammar.

:param diff_opts: List of options for external (GNU) diff.
:return: List of options with default style=='unified'.
rx)�style_option_list�
startswith�append)�	diff_opts�s�js   r�default_style_unifiedr�sN�����A��|�|�A�����
�
����	������rc�
�SSKnUR5 URSS9upxURSS9up�[R"US5n[R"U	S5nURU5 URU5 UR
5 UR
5 U(d/n[RS:Xa"URS5nURS5nS	S
UUS
UU
S/n
[U5nU(aU
RU5 [U
SS
9nUR5unnURnUS-
nUS:XGaUn[U
SS
9nUR5unnURUS-5 URS:wa%[ R""SR%U
55eUR'SS5Sn[(R*"SU[(R,5nUc%[ R""SR%U
55eUR
5 UR
5 SnU"U5 U"U
5 gURU5 US;a8US:aSU*3nOSU3n[ R""SR%UU
55eUR
5 UR
5 SnU"U5 U"U
5 g!UR
5 UR
5 SnU"U5 U"U
5 f=f)z;Display a diff by calling out to the external diff program.rNz
brz-diff-old-��prefixz
brz-diff-new-�wb�win32�mbcs�diffz--labelz--binaryT)rsr.r-Fzhexternal diff failed with exit code 2 when run with LANG=C and LC_ALL=C, but not when run natively: {!r}rs^(binary )?files.*differ$z4external diff failed with exit code 2; command: {!r}c��[R"U5 g![a:nUR[R4;a[SX5 SnAgSnAgSnAff=f)Nz&Failed to delete temporary file: %s %s)rg�removermrnror
)rtrvs  r�cleanup�external_diff.<locals>.cleanup�sJ��
O��	�	�$����
O��7�7�5�<�<�/�1��D�d�N�N�2��
O�s��
A�+A�A)rrzsignal z
exit code z+external diff failed with {}; command: {!r})�tempfile�flush�mkstemprg�fdopen�
writelines�close�sys�platformr4r��extendrw�communicate�
returncoder7r�BzrError�format�split�re�match�I)r9r:r;r<r=r}r��	oldtmp_fd�old_abspath�	newtmp_fd�new_abspath�oldtmpf�newtmpfrrru�out�err�rc�
lang_c_out�
first_line�mr��msgs                       r�
external_diffr�s�����M�M�O�%�-�-�_�-�E��I�%�-�-�_�-�E��I��i�i�	�4�(�G��i�i�	�4�(�G�i�	���8�$����8�$��
�
���
�
����I��<�<�7�"�"�(�(��0�I�!�(�(��0�I���������	
��*�)�4�	���N�N�9�%�#�G�D�A���#�#�%���S�
�_�_��	�u���
��7�
�J�(���F�D��'�'�)�H�C��
�M�M�#��+�&����!�#��o�o�7�7=�v�g����$�)�)�%��3�A�6�J����5�z�2�4�4�H�A��y��o�o�J�Q�Q������"	�
�
���
�
��	O�	������7	�
�
�c��
�V���A�v����u�o��"�2�$�'���/�/�=�D�D�S�'�R��
��	�
�
���
�
��	O�	�������	�
�
���
�
��	O�	������s�&F.K
�	AK
�
5Lc�^�SnSnUbN[U5S:�aUSnUcUR5n[U5S:�aUSnUcUR5n/nSn	Sn
Ub[U5S:XaSnSn
OUbUbUnSn	O
USnUSSnU4Sjn/n
UcWn[RR	U5up�nU"X�5 U
(a7US:wa1UbU(a[
R
UU5 U
RU5 [XnU5nUnUcWnX2:wah[RR	U5up�nU"X�5 U
(a7US:wa1UbU(a[
R
UU5 U
RU5 [X~X�SLS	9nUnU	(aUbURX�S
9nU
RU5 [U
5S:XapSn
UbkUR5(aVU(aOUR
R5nU(a.Un
[
RU5n[[S5U-5 SnUbUUU4;aU4nUUUUU
U4$)a�Get the trees and specific files to diff given a list of paths.

This method works out the trees to be diff'ed and the files of
interest within those trees.

:param path_list:
    the list of arguments passed to the diff command
:param revision_specs:
    Zero, one or two RevisionSpecs from the diff command line,
    saying what revisions to compare.
:param old_url:
    The url of the old branch or tree. If None, the tree to use is
    taken from the first path, if any, or the current working tree.
:param new_url:
    The url of the new branch or tree. If None, the tree to use is
    taken from the first path, if any, or the current working tree.
:param exit_stack:
    an ExitStack object. get_trees_and_branches_to_diff
    will register cleanups that must be run to unlock the trees, etc.
:param apply_view:
    if True and a view is set, apply the view or check that the paths
    are within it
:returns:
    a tuple of (old_tree, new_tree, old_branch, new_branch,
    specific_files, extra_trees) where extra_trees is a sequence of
    additional trees to search in for file-ids.  The trees and branches
    will be read-locked until the cleanups registered via the exit_stack
    param are run.
NrrT�.Fc�>�Ub TRUR55 gUb TRUR55 ggr)�
enter_context�	lock_read)�wt�br�
exit_stacks  �r�lock_tree_or_branch�Bget_trees_and_branches_to_diff_locked.<locals>.lock_tree_or_branch�s:���
�>��$�$�R�\�\�^�4�
�^��$�$�R�\�\�^�4�r�)�basis_is_default)�
apply_viewz+*** Ignoring files outside view. View is %s)r6�
get_branch�
controldir�
ControlDir�open_containing_tree_or_branch�views�check_path_in_viewr|�_get_tree_to_diff�safe_relpath_filesr��supports_views�lookup_view�view_display_strr�gettext)�	path_list�revision_specs�old_url�new_urlr�r��old_revision_spec�new_revision_spec�other_paths�make_paths_wt_relative�consider_relpath�default_locationr��specific_files�working_tree�branch�relpath�old_tree�
old_branch�new_tree�
new_branch�
view_files�view_str�extra_treess    `                   r�%get_trees_and_branches_to_diff_lockedr��s����B�����!��~���"� .�q� 1����+�6�6�8���~���"� .�q� 1����+�6�6�8���K�!������C�	�N�a�/��� ��	�	��!4���!&��$�Q�<�����m��5��N���"�����<�<�W�E�"�L�'���-��G�r�M��#�
��$�$�\�7�;����g�&� �!2�&�I�H��J���"�����!�!�@�@��I�	&��g�	�L�1���2�
��'�J��(�(��w�?��!�!�'�*� ���RV�BV��H��J��,�":�"�5�5��6�
�����+�&�
�>��a�����#��(C�(C�(E�(E�*�%�+�+�7�7�9�J��!+�� �1�1�*�=���W�J�K�h�V�W��K���L��8�8L�$L�#�o���h�
�J���T�Trc��UcUbURnUb
URc,U(a#UbUR5$UR5$U$URU5$r)r��spec�
basis_tree�as_tree)r��treer�r�s    rr�r�s\��
�~�$�*������|�t�y�y�(�������(�(��(�(�*�*��K��<�<���rza/zb/r9r;r@�usingc
��Uc[nU
c[n
[R"5nUR	UR55 Ub(UH"n
UR	U
R55 M$ UR	UR55 U
R
UUUUUUUU	US9	nURX75sSSS5 $!,(df   g=f)a�Show in text form the changes from one tree to another.

:param to_file: The output stream.
:param specific_files: Include only changes to these files - None for all
    changes.
:param external_diff_options: If set, use an external GNU diff and pass
    these options.
:param extra_trees: If set, more Trees to use for looking up file ids
:param path_encoding: If set, the path will be encoded as specified,
    otherwise is supposed to be utf8
:param format_cls: Formatter class (DiffTree subclass)
N�rA)�DEFAULT_CONTEXT_AMOUNT�DiffTree�
contextlib�	ExitStackr�r��from_trees_options�	show_diff)r�r�r=r��external_diff_optionsr9r;r�r@r��
format_cls�contextr�r��differs               r�show_diff_treesr�s���4��(�����
�	�	�	�	�:�� � ��!3�!3�!5�6��"�#���(�(����)9�:�$�� � ��!3�!3�!5�6��.�.�����!����!�/�

������<�#
 �	�	�s�BC�
Cc�t�URU5n[RU5$![a SnN#f=f)z7Returns a timestamp suitable for use in a patch header.r)�get_file_mtimer�	timestamp�format_patch_date)r�rt�mtimes   r�_patch_header_dater�Ks@����#�#�D�)���&�&�u�-�-��$�����s�(�7�7c�4�SSSS.nX:waSX X!4-/$/$)Ns+xs-xs??)TFNs%s to %sr%)�old_is_x�new_is_x�descrs   r�get_executable_changer�Ts<����e�4�E���������
�
�	
��	rc�T�\rSrSrSrSrSrSrSSjrSr	\
S5r\S	5r
S
rg)
�DiffPathibz0Base type for command object that compare files.�CANNOT_DIFF�CHANGED�	UNCHANGEDc�4�XlX lX0lX@lg)aConstructor.

:param old_tree: The tree to show as the old tree in the comparison
:param new_tree: The tree to show as new in the comparison
:param to_file: The file to write comparison data to
:param path_encoding: The character encoding to write paths in
N�r�r�r=r@)rr�r�r=r@s     rr�DiffPath.__init__ls��!�
� �
���*�rc��grr%�rs r�finish�DiffPath.finishy���rc�h�U"URURURUR5$rr���klass�	diff_trees  r�from_diff_tree�DiffPath.from_diff_tree|s3�������������#�#�	
�	
rc��UH,nURXX45nU[RLdM*Us $ [R$r)r�r�r�)�differs�old_path�new_path�old_kind�new_kind�file_differ�results       r�
_diff_many�DiffPath._diff_many�s?��"�K� �%�%�h�(�M�F��X�1�1�1��
�#�
�'�'�'r)r�r�r@r=N��utf-8)rr r!r"r#r�r�r�rr�classmethodr	�staticmethodrr$r%rrr�r�bsH��:� �K��G��I�+�
��
��
��(��(rr�c�:�\rSrSrSrSrSr\S5rSr	Sr
g)	�DiffKindChangei�zzSpecial differ for file kind changes.

Represents kind change as deletion + creation.  Uses the other differs
to do this.
c��Xlgr�r)rrs  rr�DiffKindChange.__init__�s���rc��grr%rs rr�DiffKindChange.finish�rrc�&�U"UR5$rrrs  rr	�DiffKindChange.from_diff_tree�s���Y�&�&�'�'rc���SX44;a[R$[RURXUS5nU[RLaU$[RURXSU5$)z�Perform comparison.

:param old_path: Path of the file in the old tree
:param new_path: Path of the file in the new tree
:param old_kind: Old file-kind of the file
:param new_kind: New file-kind of the file
N)r�r�rr)rr
rrrrs      rr��DiffKindChange.diff�sd���H�'�'��'�'�'��$�$�T�\�\�8�x�QU�V���X�)�)�)��M��"�"�4�<�<��T�8�T�TrrN)rr r!r"r#rrrr	r�r$r%rrrr�s+����
��(��(�
Urrc��\rSrSrSrSrg)�DiffTreeReferencei�c��SX44;aUR$US;aUR$US;aUR$UR$)z9Perform comparison between two tree references.  (dummy).�tree-reference)r'N�r�r��rr
rrrs     rr��DiffTreeReference.diff�sM���H�#7�7��#�#�#��3�3��#�#�#��3�3��#�#�#��|�|�rr%N�rr r!r"r�r$r%rrr%r%����rr%c��\rSrSrSrSrg)�
DiffDirectoryi�c��SX44;aUR$US;aUR$US;aUR$UR$)z5Perform comparison between two directories.  (dummy).�	directory)r0Nr(r)s     rr��DiffDirectory.diff�sM���x�2�2��#�#�#��.�.��#�#�#��.�.��#�#�#��|�|�rr%Nr+r%rrr.r.�r,rr.c� �\rSrSrSrSrSrg)�DiffSymlinki�c��SX44;aUR$US:XaURRU5nOUcSnOUR$US:XaURRU5nOUcSnOUR$UR	XV5$)z�Perform comparison between two symlinks.

:param old_path: Path of the file in the old tree
:param new_path: Path of the file in the new tree
:param old_kind: Old file-kind of the file
:param new_kind: New file-kind of the file
�symlinkN)r�r��get_symlink_targetr��diff_symlink)rr
rrr�
old_target�
new_targets       rr��DiffSymlink.diff�s����X�0�0��#�#�#��y� ����9�9�(�C�J�
�
��J��#�#�#��y� ����9�9�(�C�J�
�
��J��#�#�#�� � ��8�8rc���UcDURRSURURS5-5 UR$UcDURRSURURS5-5 UR$URRSURURS5URURS54-5 UR$)Ns=== target is '%s'
r(s=== target was '%s'
s === target changed '%s' => '%s'
)r=r7r4r@r�)rr8r9s   rr7�DiffSymlink.diff_symlink�s������L�L���'��#�#�D�$6�$6�	�B�C�
�"�|�|���
��L�L���(��#�#�D�$6�$6�	�B�C�
��|�|��
�L�L���4��%�%�d�&8�&8�)�D��%�%�d�&8�&8�)�D���
��|�|�rr%N)rr r!r"r�r7r$r%rrr3r3�s��9�0rr3c�8�\rSrSrSrSSS\\4SjrSrSr	Sr
g	)
�DiffTexti�z1970-01-01 00:00:00 +0000rr�c	�n�[RXX#U5 XplXPlX`lX@lX�lgr)r�r�text_differr9r;r@rA)	rr�r�r=r@r9r;r@rAs	         rr�DiffText.__init__�s2��	���$�(�]�K�&��"��"��*��*�rc���SX44;aUR$US:Xa[URU5nOUc
URnOUR$US:Xa[URU5nOUc
URnOUR$SRURU=(d UU5nSRURU=(d UU5nURXXx5$)z�Compare two files in unified diff format.

:param old_path: Path of the file in the old tree
:param new_path: Path of the file in the new tree
:param old_kind: Old file-kind of the file
:param new_kind: New file-kind of the file
�filez{}{}	{})	r�r�r��
EPOCH_DATEr�r�r9r;�	diff_text)	rr
rrr�old_date�new_date�
from_label�to_labels	         rr��
DiffText.diffs����(�-�-��#�#�#��v��)�$�-�-��B�H�
�
����H��#�#�#��v��)�$�-�-��B�H�
�
����H��#�#�#��&�&�t�~�~�x�7K�8�X�V�
��$�$�T�^�^�X�5I��8�T���~�~�h�*�G�Grc
��SnU"URU5nU"URU5nURUUUUURURUR
S9 UR$![Ra{ URRSRURU=(d UURU=(d U5RURS55 UR$f=f)a)Diff the content of given files in two trees.

:param from_path: The path in the from tree. If None,
    the file is not present in the from tree.
:param to_path: The path in the to tree. This may refer
    to a different file from from_path.  If None,
    the file is not present in the to tree.
c�h�Uc/$URU5$![Ra /s$f=fr)�get_file_lines�_mod_transport�
NoSuchFile)r�rts  r�	_get_text�%DiffText.diff_text.<locals>._get_text2s<���|��	�
��*�*�4�0�0��!�,�,�
��	�
�s��1�1)r@rAz"Binary files {}{} and {}{} differ
r()r�r�r@r=r@rAr�
BinaryFiler7r�r9r;r4r�)r�	from_path�to_pathrHrIrP�	from_text�to_texts        rrE�DiffText.diff_text(s���	�	�!�$�-�-��;�I���
�
�w�7�G�����������"�0�0�"�0�0�
�
�(�|�|���� � �
	��L�L���9�@�@����!�,�W�����,�9�	��&��+�+�Y�7�	
��|�|��
	�s�AA*�*BC9�8C9)rAr;r9r@r@N)rr r!r"rDrDr�rr�rEr$r%rrr>r>�s*��-�J����!�,�+�$H�4)rr>c
���\rSrSrSS\\\\4S\S\4Sjjr\	SS\\\\4S\S\S\4Sjj5r
\	SS	j5rS
rSr
Sr\S
5rSrSrSSjrSSjrSrSrSrSrg)�DiffFromTooliT�command_templater�r�c�n�SSKn[RXX4U5 XlUR	SS9Ulg)Nrz	brz-diff-r�)r�r�rrZ�mkdtemp�_root)rrZr�r�r=r@r�s       rr�DiffFromTool.__init__Us4��	����$�(�]�K� 0���%�%�[�%�9��
rr@c��U"XX4U5$rr%)rrZr�r�r=r@s      r�from_string�DiffFromTool.from_stringds���%��M�R�RrNc�^^^�UUU4SjnU$)Nc�>�T/nTbURTR55 TRUURURUR
5$r)r�r�r`r�r�r=)r�full_command_string�command_stringr�rs  ���rr	�8DiffFromTool.make_from_diff_tree.<locals>.from_diff_treeqs[���#1�"2��$�0�#�*�*�+@�+F�+F�+H�I��$�$�#��"�"��"�"��!�!�	�
rr%)rrer�r	s``` r�make_from_diff_tree� DiffFromTool.make_from_diff_treeos���		��rc�j�XS.nURVs/sHoDR"S0UD6PM nnXPR:XaXQU/-
n[RS:XaU/nUHKn[	U[
5(a"UR
URS55 M:UR
U5 MM U$U$s snf)N)r
rr�r�r%)rZr�r�r��
isinstancerqr|r4)rr
r�my_map�t�command�command_encoded�cs        r�_get_command�DiffFromTool._get_command~s���&�=��/3�/D�/D�E�/D�!�8�8�%�f�%�/D��E��+�+�+��(�+�+�G��<�<�7�"� �O����a��%�%�#�*�*�1�8�8�F�+;�<�#�*�*�1�-�	�
#�"��N��Fs�B0c���URX5n[RU[RURS9nURRURR55 URR5 UR5$![
a=nUR[R:Xa[R"US5eeSnAff=f)N)rd�cwdr)rprjrlrkr]rmrnror�ExecutableMissingr=r7rd�readr��wait)rr
rrm�procrvs      r�_execute�DiffFromTool._execute�s����#�#�H�7��	��#�#�G�J�O�O����#�T�D�	
�����4�;�;�+�+�-�.��������y�y�{����	��w�w�%�,�,�&��.�.�w�q�z�:�:���		�s�-B�
C$�'8C�C$c�d�[USS5b%[R"UR5(dg[R
"UR
S5[R"URU55 g![a)nUR[R:waeSnAgSnAff=f)N�abspathFr�T)�getattrr�supports_symlinksr]rgr5r{�pathjoinrmrn�EEXIST)rr�r�rvs    r�_try_symlink_root�DiffFromTool._try_symlink_root�s����4��D�)�1��9R�9R��J�J�:
�:
��	��J�J�t�|�|�B�'��)9�)9�$�*�*�f�)M�N����	��w�w�%�,�,�&��'���	�s�AA<�<
B/�B*�*B/c�h�[RS:Xag[R"5=(d S$)z9Returns safe encoding for passing file path to diff tool.r�r��ascii)r�r��getfilesystemencodingr%rr�_fenc�DiffFromTool._fenc�s)���<�<�7�"���,�,�.�9�'�9rc��UR5nXRU5RU5:H$![a gf=f)z8Return true if `path` may be able to pass to subprocess.F)r�r4�decode�UnicodeError)rrt�fencs   r�_is_safepath�DiffFromTool._is_safepath�sA���z�z�|��	��;�;�t�,�3�3�D�9�9�9���	��	�s�!4�
A�Ac���UR5nURUS5RUS5nURSS5n[R
"URX5$)zVReplace unsafe character in `relpath` then join `self._root`,
`prefix` and `relpath`.
r(�?�_)r�r4r�r(rr~r])rr�r�r��relpath_tmps     r�_safe_filename�DiffFromTool._safe_filename�sW���z�z�|���n�n�T�9�5�<�<�T�9�M��!�)�)�#�s�3������
�
�F�@�@rc�2�U(d>[U[5(a)URU5nURU5(aU$UR	X15nU(dURX#5(aU$[R"U5n[R"U5 URU5n	[US5n
[R"X�5 SSS5 SSS5 UR!U5n[R""XkU45 U(d[R&"U5 U$![a)nUR[R:waeSnAN�SnAff=f!,(df   N�=f!,(df   N�=f![$a N�f=f)Nr�)rj�WorkingTreer{r�r�r�r�dirnamerg�makedirsrmrnr�get_file�open�pumpfiler��utimer�
make_readonly)rr�r�r��
force_temp�allow_write�	full_path�
parent_dirrv�source�targetr�s            r�_write_file�DiffFromTool._write_file�s<���j��{�;�;����W�-�I�� � ��+�+� � ��'�'��8�	��d�4�4�T�B�B����_�_�Y�/�
�	��K�K�
�#��]�]�7�
#�v�t�I�t�/D�����V�,�0E�
#�	0��'�'��0�E�
�H�H�Y���/���!�!�)�,�����	��w�w�%�,�,�&��'��	��0E�/D��
#�
#��(�	��	�sN�
D1�4
E8�E'�E8�)F	�1
E$�;E�E$�'
E5	�1E8�8
F�	
F�Fc�x�URXRSU5nURX RSX4S9nXV4$)N�old�new)r�)r�r�r�)rr
rr��allow_write_new�
old_disk_path�
new_disk_paths       r�_prepare_files�DiffFromTool._prepare_files�sG���(�(��=�=�%��T�
��(�(��m�m�U�J�)�
�
��+�+rc��[R"UR5 g![aRnUR[R
:wa*[
SRURU55 SnAgSnAgSnAff=f)Nz9The temporary directory "{}" was not cleanly removed: {}.)r�rmtreer]rmrnrorr�)rrvs  rr�DiffFromTool.finish�s`��	��N�N�4�:�:�&���	��w�w�%�,�,�&��O�V�V��
�
�A����'��	�s� #�
A?�AA:�:A?c�z�X44S:wa[R$URX5upVURXV5 g)N)rCrC)r�r�r�rx)rr
rrrr�r�s       rr��DiffFromTool.diff�s9����#3�3��'�'�'�)-�)<�)<�X�)P�&���
�
�m�3rc���URXSSS9up4URX45n[RXPRS9 [US5nUR
5sSSS5 $!,(df   g=f)z�Use this tool to edit a file.

A temporary copy will be edited, and the new contents will be
returned.

:return: The new contents of the file.
T)r�r�)rs�rbN)r�rprj�callr]r�ru)rr
r�old_abs_path�new_abs_pathrm�new_files       r�	edit_file�DiffFromTool.edit_file�sh��&*�%8�%8����&9�&
�"���#�#�L�?������Z�Z��0�
�,��
%���=�=�?�&�
%�
%�s�A(�(
A6)r]rZrr)FF)rr r!r"rrqr5rrrr`rgrprxr�rr�r�r�r�r�rr�r�r$r%rrrYrYTs����

:���T�#�Y��/�
:��
:��	
:��%�
S���T�#�Y��/�S��S��	S��
S��S������ �
��:��:��	A��8EJ�,�	�4�#rrYc��\rSrSrSr\R\R\R/r	SSjr
\S5rSSjr
SrSrS	rS
rg)
r�i
aProvides textual representations of the difference between two trees.

A DiffTree examines two trees and where a file-id has altered
between them, generates a textual representation of the difference.
DiffTree uses a sequence of DiffPath objects which are each
given the opportunity to handle a given altered fileid. The list
of DiffPath objects can be extended globally by appending to
DiffTree.diff_factories, or for a specific diff operation by
supplying the extra_factories option to the appropriate method.
Nc	�^�Uc[XX4SS[5nUTlUTlUTlUTl/TlUb%TRRU4SjU55 TRRU4SjTR55 TRRU[RT5/5 g)a�Constructor.

:param old_tree: Tree to show as old in the comparison
:param new_tree: Tree to show as new in the comparison
:param to_file: File to write comparision to
:param path_encoding: Character encoding to write paths in
:param diff_text: DiffPath-type object to use as a last resort for
    diffing text files.
:param extra_factories: Factories of DiffPaths to try before any other
    DiffPaths
Nr�c3�2># �UHo"T5v� M g7frr%��.0�frs  �r�	<genexpr>�$DiffTree.__init__.<locals>.<genexpr><s����A��A��$������c3�2># �UHo"T5v� M g7frr%r�s  �rr�r�=s����A�-@��A�d�G�G�-@�r�)r>rDr�r�r=r@rr��diff_factoriesrr	)rr�r�r=r@rE�extra_factoriess`      rr�DiffTree.__init__s����(�� ��G�B��M��I�!��
� ��
����*�������&��L�L���A��A�A������A�T�-@�-@�A�A������Y��(E�(E�d�(K�L�Mrc
�^
�Ub[RX�5/n
O/n
U(aUR5m
SU
4SjjnO[n[	UUUUUUUU	S9nU"XX4X�5$)agFactory for producing a DiffTree.

Designed to accept options used by show_diff_trees.

:param old_tree: The tree to show as old in the comparison
:param new_tree: The tree to show as new in the comparison
:param to_file: File to write comparisons to
:param path_encoding: Character encoding to use for writing paths
:param external_diff_options: If supplied, use the installed diff
    binary to perform file comparison, using supplied options.
:param old_label: Prefix to use for old file labels
:param new_label: Prefix to use for new file labels
:param using: Commandline to use to invoke an external diff tool
c�">�[XX#UT5 g)zU:param path_encoding: not used but required
to match the signature of internal_diff.
N)r�)�olab�olines�nlab�nlinesr=r@rA�optss       �r�	diff_file�.DiffTree.from_trees_options.<locals>.diff_fileds����d�D�'�4�Hrr��NN)rYrgr�rDr>)rr�r�r=r@r�r9r;r�rAr�r�rEr�s             @rr��DiffTree.from_trees_options@s����6���0�0��N��O�!�O� �(�.�.�0�D�#�"�
I�
I�&�I���������'�	
�	����	�
�	
rc��URX5URHnUR5 M $!URHnUR5 M f=f)z�Write tree diff to self.to_file.

:param specific_files: the specific files to compare (recursive)
:param extra_trees: extra trees to use for mapping paths to file_ids
)�
_show_diffrr)rr�r�r�s    rr��DiffTree.show_diff�sB��	 ��?�?�>�?��,�,���
�
��'��$�,�,���
�
��'�s	�6�%Ac�^�TRRTRUUSS9nSnSnU4Sjn[X5S9GH�nURS(dURS(aUR
S:XaM>UR
SS	:XaHTRR
5(d)[S
RURS55 M�URup�U"U5n
U"U	5nUR
SSL=(a URSnUR
SSL=(a URSn
URnUR
nURn/nUR[USUS55 U(aSSRU54-nOS
nX�4S:Xa3TRR!SUSR#S5U
4-5 O�X�4S:Xa3TRR!SUSR#S5U4-5 OoU(a5TRR!SUSR#S5U
UU4-5 O3TRR!SUSR#S5UU4-5 UR$(aTR'X�USUS5 SnU(dGM�SnGM� U$)NT)r�r��require_versionedrc�0�URupUnUcUnU$r)rt)�changer
rrts    r�changes_key�(DiffTree._show_diff.<locals>.changes_key�s"��!'����H��D��|����Krc�D>�UbURTRS5$g)Nr()r4r@)rtrs �r�get_encoded_path�-DiffTree._show_diff.<locals>.get_encoded_path�s%������{�{�4�#5�#5�y�A�A� r)�keyrr�r5z?Ignoring "{}" as symlinks are not supported on this filesystem.s (properties changed: %s)s, r)TFs=== removed %s '%s'
r�)FTs=== added %s '%s'
s=== renamed %s '%s' => '%s'%s
s=== modified %s '%s'%s
)r��iter_changesr��sortedrt�kindr}r
r��	versioned�
executable�renamedr�r��joinr=r7r4�changed_content�_diff)rr�r��iterator�has_changesr�r�r��oldpath�newpath�oldpath_encoded�newpath_encoded�old_present�new_presentr�r�r��properties_changed�prop_strs`                  rr��DiffTree._show_diff�s�����=�=�-�-��M�M�)�#�"�	.�
����	�	B��X�7�F��K�K��N�6�;�;�q�>�f�k�k�N�?���{�{�1�~��*�4�=�=�3R�3R�3T�3T��4�4:�F�6�;�;�q�>�4J���%�{�{��G�.�w�7�O�.�w�7�O� �+�+�a�.��4�L��9I�9I�!�9L�K� �+�+�a�.��4�L��9I�9I�!�9L�K��*�*�J��;�;�D��n�n�G�!#���%�%�%�j��m�Z��]�C�
�"�7��J�J�1�2�;������)�]�:����"�"�,��A�w�~�~�g�.��@�A���+�}�<����"�"�*�d�1�g�n�n�W�.E��-W�W������"�"�6��Q����w�/�'�'� �	������"�"�/��A�w�~�~�g�.���J�K���%�%��
�
�7�T�!�W�d�1�g�>����w���C8�D�rc��UcSnOURRU5nUcSnOURRU5nURXX45 g)z�Perform a diff of a single file.

:param old_path: The path of the file in the old tree
:param new_path: The path of the file in the new tree
N)r�r�r�r�r)s     rr��
DiffTree.diff�sP�����H��}�}�)�)�(�3�H����H��}�}�)�)�(�3�H��
�
�8�x�:rc��[RURXX45nU[RLaUnUcUn[R
"U5egr)r�rrr�r�NoDiffFound)rr
rrrr�
error_paths       rr��DiffTree._diff�sS���$�$��L�L�(�h�
���X�)�)�)�!�J��!�%�
��$�$�Z�0�0�	*r)rr�r�r@r=)rNNr)rr r!r"r#r3r	r.r%r�rrr�r�r�r�r�r$r%rrr�r�
sh��	�	�"�"��$�$��(�(��N���� N�D�>
��>
�@
 �X�t;� 1rr��default)rrrrrr.N)T)NNT)2r�rrgr�r��typingrrr�globalsr�rrr	rN�registryr
�tracerrr
r�rrr�rrrDr3rwrzr�r�r�r�rqr�r�r�r�rr%r.r3r>rYr��type�format_registry�registerr%rr�<module>rs���"��	�	�
�"�$���I���&�)��(�(�0�����0�0�����(�2�p�����
��I&�X$�P��.�0u�rIM�tU�n �$��������"�/=��
/=��/=��/=��C�=�/=�d.��*(�*(�ZU�U�B	��	�	�H�	�,�(�,�^Z�x�Z�zs#�8�s#�lu1�u1�p�3��X��.�/�1������H�-r

Youez - 2016 - github.com/yon3zu
LinuXploit