403Webshell
Server IP : 74.208.236.52  /  Your IP : 216.73.217.98
Web Server : Apache
System : Linux infong527 4.4.400-icpu-115 #2 SMP Mon Jul 6 08:15:05 UTC 2026 x86_64
User : u44043973 ( 5404757)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/mercurial/__pycache__/simplemerge.cpython-313.pyc
�

6�h�L���SSKJr SSKJr SSKJrJr SSKJr Sr	Sr
Sr"S	S
5rSr
SrS
rSrSSjrSrSrSr"SS5rSSjrg)�)�annotations�)�_)�error�mdiff)�
stringutilc��USUS::deUSUS::de[USUS5n[USUS5nX#:aX#4$g)z�Given two ranges return the range where they intersect or None.

>>> intersect((0, 10), (0, 6))
(0, 6)
>>> intersect((0, 10), (5, 15))
(5, 10)
>>> intersect((0, 10), (10, 15))
>>> intersect((0, 9), (10, 15))
>>> intersect((0, 9), (7, 15))
(7, 9)
rrN��max�min��ra�rb�sa�sbs    �7/usr/lib/python3/dist-packages/mercurial/simplemerge.py�	intersectrsc���a�5�B�q�E�>��>�
�a�5�B�q�E�>��>�	�R��U�B�q�E�	�B�	�R��U�B�q�E�	�B�	�w��v�
��c��USUS::deUSUS::de[USUS5n[USUS5nX#::aX#4$g)a5Given two ranges return the range where they intersect or touch or None.

>>> intersect_or_touch((0, 10), (0, 6))
(0, 6)
>>> intersect_or_touch((0, 10), (5, 15))
(5, 10)
>>> intersect_or_touch((0, 10), (10, 15))
(10, 10)
>>> intersect_or_touch((0, 9), (10, 15))
>>> intersect_or_touch((0, 9), (7, 15))
(7, 9)
rrNr
r
s    r�intersect_or_touchr4sc���a�5�B�q�E�>��>�
�a�5�B�q�E�>��>�	�R��U�B�q�E�	�B�	�R��U�B�q�E�	�B�	�x��v�
�rc��X!-
XT-
:wag[[X5[XE55HupgXX7:wdM g g)z:Compare a[astart:aend] == b[bstart:bend], without slicing.FT)�zip�range)�a�astart�aend�b�bstart�bend�ia�ibs        r�
compare_ranger"LsB���
�4�=�)���e�F�)�5��+>�?����5�A�E�>��@�rc�<�\rSrSrSrS	SjrSrSrSrSr	g)
�
Merge3Text�Wz�3-way merge of texts.

Given strings BASE, OTHER, THIS, tries to produce a combined text
incorporating the changes from both BASE->OTHER and BASE->THIS.Nc���XlX lX0lUc[R"U5nUc[R"U5nUc[R"U5nXplX@lXPlX`lg�N)	�basetext�atext�btextr�
splitnewlines�relaxed_sync�baserr)�selfr(r)r*r-rrr,s        r�__init__�Merge3Text.__init__]sg��!�
��
��
��<��&�&�x�0�D��9��#�#�E�*�A��9��#�#�E�*�A�(���	����rc#�# �UR5H�nUSnUS:XaX RUSUS4v� M(US:XdUS:XaX RUSUS4v� MNUS:XaX RUSUS4v� MnUS:XaDUURUSUSURUS	US
URUSUS44v� M�[	U5e g
7f)aUYield sequence of line groups.  Each one is a tuple:

'unchanged', lines
     Lines unchanged from base

'a', lines
     Lines taken from a

'same', lines
     Lines taken from a (and equal to b)

'b', lines
     Lines taken from b

'conflict', (base_lines, a_lines, b_lines)
     Lines from base were changed to either a or b and conflict.
r�	unchangedr��a�same�b�conflict����N)�
merge_regionsr-rr�
ValueError)r.�t�whats   r�merge_groups�Merge3Text.merge_groupsus����$�#�#�%�A��Q�4�D��|�#��I�I�a��d�Q�q�T�2�2�2��������F�F�1�Q�4�!�A�$�/�/�/�����F�F�1�Q�4�!�A�$�/�/�/���$���	�	�!�A�$��1��.����q��t�a��d�+����q��t�a��d�+����!��&�&�%&�s�CCc	#��# �S=n=p#UR5GHLnUupVpxp�Xe-
nUS:�deX�U-
:XdeX�U	-
:XdeXr-
nX�-
n
XQ-
nUS:�deU
S:�deUS:�deU(dU
(a�[URX'URX5n[URX9URX5n[URX'URX95nU(aSX'4v� OLU(aU(dSX94v� O7U(aU(dSX'4v� O"U(dU(d	SXX'X94v� O[S5eUnU	nUnUS:�dGM+X':XdeX9:XdeX:XdeSXV4v� UnUnU
nGMO g7f)	aVReturn sequences of matching and conflicting regions.

This returns tuples, where the first value says what kind we
have:

'unchanged', start, end
     Take a region of base[start:end]

'same', astart, aend
     b and a are different from base but give the same result

'a', start, end
     Non-clashing insertion from a[start:end]

'conflict', zstart, zend, astart, aend, bstart, bend
    Conflict between a and b, with z as common ancestor

Method is as follows:

The two sequences align only on regions which match the base
and both descendants.  These are found by doing a two-way diff
of each one against the base, and then finding the
intersections between those regions.  These "sync regions"
are by definition unchanged in both and easily dealt with.

The regions in between can be in any of three cases:
conflicted, or changed on only one side.
rr5r6r4r7s#can't handle a=b=base but unmatchedr2N)�find_sync_regionsr"rr-r�AssertionError)r.�izr r!�region�zmatch�zend�amatchr�bmatchr�matchlen�len_a�len_b�len_base�equal_a�equal_b�sames                  rr<�Merge3Text.merge_regions�s����>����R��,�,�.�F�7=�4�F�&���}�H��q�=� �=��v�
�.�.�.��v�
�.�.�.��K�E��K�E��{�H��A�:��:��A�:��:��q�=� �=���'��F�F�B��	�	�2���(��F�F�B��	�	�2���%�T�V�V�R�����L���!�2�-�-��W���*�*��W���*�*� ��%�r�2�r�I�I�(�)O�P�P������B�
�!�|��|�#�|��|�#�|��|�#�|�"�F�0�0�������m/�s�D<E*�'E*c�>�S=p[R"URUR5n[R"URUR5n[U5n[U5nUR(a[nO[n/nX:Ga�X&:Ga�X1up�nXBup�nU"X�U-4X�U-45nU(a�USnUSnUU-
nUU::deUU::deU	U::deUU::deU
UU	-
-nU
UU-
-nUU-nUU-nURUUURUU:Xd#URUUURUU45eURUUURUU:XdeURUUUUUU45 X�-X�-:aUS-
nO�UR(dUS-
nOpX�-X�-:�aUS-
nO`US-U:XaUS-
nOQUS-U:XaUS-
nOBX1S-SXBS-S:�aUS-
nO&X1S-SXBS-S:aUS-
nO
US-
nUS-
nX:aX&:aGM�[UR5n[UR5n	[UR5nUUX�X�4nU(aU[U5S-
U:XdURU5 U$)z�Return a list of sync regions, where both descendants match the base.

Generates a list of (base1, base2, a1, a2, b1, b2).  There is
always a zero-length sync region at the end of all the files.
rr)
r�get_matching_blocksr(r)r*�lenr,rrr-rr�append)r.r r!�amatches�bmatchesrLrM�
intersect_fun�sl�abaserI�alen�bbaserJ�blen�i�intbase�intend�intlen�asub�bsubrr�
sentinel_hunks                        rrC�Merge3Text.find_sync_regions�s�������,�,�T�]�]�D�J�J�G���,�,�T�]�]�D�J�J�G���H�
���H�
�����.�M�%�M�
���j�R�Z�"*�,��E�4�"*�,��E�4��u�d�l�3�e�T�\�5J�K�A���A�$���1����'�)����~�%�~���~�%�~���'�'�'���'�'�'���5��1����5��1���f�}���f�}���y�y���0�D�F�F�4��4E�E���I�I�g�f�-��F�F�4��%�H��E�
�y�y���0�D�F�F�4��4E�E�E�E��	�	�7�F�D�$��d�C�D�����.��a����&�&��a����,�5�<�0��a���
��6�U�?��!�G�B��!�V�u�_��!�G�B��1�f�%�a�(�8��F�+;�A�+>�>��!�G�B��1�f�%�a�(�8��F�+;�A�+>�>��!�G�B�
�!�G�B��!�G�B�{�j�R�Z�~�d�i�i�.���D�F�F����D�F�F��� �'�5��F�
��r�#�b�'�A�+��-�7��I�I�m�$��	r)rr)rr-r(r*r,)NNNF)
�__name__�
__module__�__qualname__�__firstlineno__�__doc__r/r@r<rC�__static_attributes__�rrr$r$Ws.��G��
�
���0$'�LW�r\rr$c���[R"UR55(a<[S5URR5-n[R"U5eg)zQverifies that text is non-binary (unless opts[text] is passed,
then we just warn)s%s looks like a binary file.N)r�binary�textr�fctx�pathr�Abort)�input�msgs  r�_verifytextrvSsJ���������&�&��/�0�5�:�:�?�?�3D�D���k�k�#���'rc�r�[SU55n/nUH�nUR(awUR(a2URS-RUS-5S-UR-nOURnUR	[
R"US55 M�UR	S5 M� U$)Nc3�p# �UH,oR(a[UR5OSv� M. g7f)rN)�labelrU)�.0rts  r�	<genexpr>�!_format_labels.<locals>.<genexpr>\s"���
I�&��+�+�c�%�+�+��1�4�&�s�46�:r� �H)rry�label_detail�ljustrVr�ellipsis)�inputs�pad�labelsrtrys     r�_format_labelsr�[s���

�
I�&�
I�
I�C�
�F����;�;��!�!��[�[�4�'�.�.�s�Q�w�7����(�(�)�������M�M�*�-�-�e�V�<�=��M�M�$����Mrc���[UR5S:�aHURSRS5(agURSRS5(agg)Nrs
�
�
)rUr�endswith)�m3s r�_detect_newliner�osL��
�2�4�4�y�1�}�
�4�4��7���G�$�$��
�T�T�!�W�
�
�e�
$�
$��rc�R�[U5n[U5nSnXB:a*XC:a%XX:XaUS-
nXB:aXC:aXX:XaMUnSnXB:a:XC:a5X*S-
X*S-
:Xa#US-
nXB:aXC:aX*S-
X*S-
:XaM#UnUSUnXX&-
nXX6-
n	XU-
Sn
XxX�4$)z�Trim conflict regions of lines where A and B sides match.

Lines where both A and B have made the same changes at the beginning
or the end of each merge region are eliminated from the conflict
region and are instead considered the same.
rrN)rU)�a_lines�b_linesr\r^�ii�startmatches�
endmatches�lines_before�new_a_lines�new_b_lines�lines_afters           r�	_minimizer�xs����w�<�D��w�<�D�
�B�
�)��	�g�k�W�[�&@�
�a���
�)��	�g�k�W�[�&@��L�
�B�
�)��	�g�c�A�g�&6�'�#��'�:J�&J�
�a���
�)��	�g�c�A�g�&6�'�#��'�:J�&J��J��=�L�)�L���):�;�K���):�;�K���+�-�.�K��k�>�>rNc���[U5nSnU(aUS-U-nU(aUS-U-nUR5n/n	UH�up�U
S:Xa�SnUup�n[X�5nUunp�nU	RU5 U	R	X6-5 U	RU
5 U	R	XF-5 U	RU5 U	R	XV-5 U	RU5 M�U	RU5 M� X�4$)zReturn merge in cvs-like form.Fr~r7T)r�r@r��extendrV)r��name_a�name_b�start_marker�
mid_marker�
end_marker�newline�	conflictsr@�linesr?�group_lines�
base_linesr�r��	minimizedr�r�s                  r�render_minimizedr��s����b�!�G��I�
�#�d�*�V�3��
��$�&��/�
��?�?�$�L��E�)����;���I�+6�(�J��!�'�3�I�:C�7�L�'�K��L�L��&��L�L��/�0��L�L��!��L�L��-�.��L�L��!��L�L��-�.��L�L��%��L�L��%�*���rc��[U5nSn/nUR5H�upxUS:Xa�Uup�nSnURSU-U-5 URU
5 URSU-U-5 URU	5 URSU-5 URU5 URSU-U-5 M�URU5 M� Xe4$)z+Render conflicts as 3-way conflict markers.Fr7Ts<<<<<<< s||||||| �=======s>>>>>>> )r�r@rVr�)r�r�r��	name_baser�r�r�r?r�r�r�r�s            r�
render_merge3r��s����b�!�G��I��E��_�_�.����;��+6�(�J���I��L�L��v�-��7�8��L�L��!��L�L��y�0�7�:�;��L�L��$��L�L��g�-�.��L�L��!��L�L��v�-��7�8��L�L��%�/���rc
��[U5n/nSnUR5GH�upxUS:XGa�Uup�nSRU	5n[[R
"USRU5U	US95n
[[R
"USRU
5U	US95nSnSnUR
SU-5 U"U5U"U
5:aoUR
SU-U-5 URU
5 UR
S	U-U-5 UR
S
U-U-5 URU"X�U55 OnUR
S	U-U-5 UR
S
U-U-5 URU"X�U
55 UR
SU-U-5 URU5 UR
SU-5 SnGM�URU5 GM� XV4$)
zDRender conflicts as conflict markers with one snapshot and one diff.Fr7r)�lines1�lines2c�&�[SU55$)Nc3�L# �UHupUS:XdM
USUS-
v� M g7f)�=rrNrm)rz�block�kinds   rr{�;render_mergediff.<locals>.matching_lines.<locals>.<genexpr>�s/����'-����t�|�(�E�!�H�u�Q�x�'�'-�s�$�$)�sum)�blockss r�matching_lines�(render_mergediff.<locals>.matching_lines�s����'-���rc3��# �UHUup4US:XaXSUSH
nSU-v� M M%XSUSH
nSU-v� M X#SUSH
nSU-v� M MW g7f)	Nr�rrr~�-r3r8�+rm)r�r�r�r�r��lines      r�
diff_lines�$render_mergediff.<locals>.diff_lines�s����#)�K�E��t�|�$*��8�e�A�h�$?�D�"&��+�-�%@�%+��8�e�A�h�$?�D�"&��+�-�%@�$*��8�e�A�h�$?�D�"&��+�-�%@�$*�s�AA�<<<<<<<s======= s------- s+++++++ �>>>>>>>T)r�r@�join�listr�	allblocksrVr�)r�r�r�r�r�r�r�r?r�r�r�r��	base_text�b_blocks�a_blocksr�r�s                 r�render_mergediffr��s����b�!�G��E��I��_�_�.����;��+6�(�J������,�I�������H�H�W�%�%�"�	��H�������H�H�W�%�%�"�	��H�
�	
.�
�L�L��g�-�.��h�'�.��*B�B����[�6�1�G�;�<����W�%����[�9�4�w�>�?����[�6�1�G�;�<����Z��g�F�G����[�9�4�w�>�?����[�6�1�G�;�<����Z��g�F�G����[�6�1�G�;�<����W�%��L�L��g�-�.��I��L�L��%�o/�p��rc��/nUR5H:up4US:XaUHnURXE5 M M)URU5 M< U$)Nr7)r@r�)r��sidesr�r?r��sides      r�_resolver�
sQ���E��_�_�.����;�������[�.�/��
�L�L��%�/��Lrc�*�\rSrSrSSjrSrSrSrg)�
MergeInputiNc�6�XlX lX0lSUlgr')rqryr��_text)r.rqryr�s    rr/�MergeInput.__init__s���	��
�)����
rc�r�URcURR5UlUR$r')r�rq�decodeddata)r.s rrp�MergeInput.text"s,���:�:�����.�.�0�D�J��z�z�rc��Xlgr')r�)r.rps  r�set_text�MergeInput.set_text.s���
r)r�rqryr�)NN)rgrhrirjr/rpr�rlrmrrr�r�s���
�rr�c�8�U(d![U5 [U5 [U5 [UR5UR5UR5US9nSnUS:Xa
[US5nO�US:Xa
[US5nO�US:Xa
[US5nOnUS	:Xa
[US
5nO[US:Xa[	XU5n	[U/U	Q76up�O:US:Xa[	XU5n	[
U/U	Q76up�O[	X5n	[U/U	Q76up�S
RU5n
X�4$)zSPerforms the simplemerge algorithm.

The merged result is written into `localctx`.
)r,Fsunion)rr3sunion-other-first)r3rslocal)rsother)r3s	mergediffsmerge3r)	rvr$rpr�r�r�r�r�r�)�localr-�other�mode�allow_binaryr,r�r�r�r��
mergedtexts           r�simplemerger�2s����E���D���E��	��	�	��U�Z�Z�\�5�:�:�<�l�
�B��I��x����V�$��	
�%�	%���V�$��	
��	���T�"��	
��	���T�"���<��#�E�$�7�F�/��<�V�<��E�9�
�Y�
�#�E�$�7�F�,�R�9�&�9��E�9�#�E�1�F�/��<�V�<��E����%��J�� � r)NNr�r�r�)smergeFF)�
__future__r�i18nr�rr�utilsrrrr"r$rvr�r�r�r�r�r�r�r�r�rmrr�<module>r�s���&#�����.�0�y�y�x��(�?�>�����
 �F�*=�@���<
���
*!r

Youez - 2016 - github.com/yon3zu
LinuXploit