HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/simplemerge.pyc
�
1�3\c@@s�ddlmZddlmZddlmZmZmZddlm	Z	de
fd��YZd�Zd	�Z
d
efd��YZd�Zd
�Zd�ZdS(i(tabsolute_importi(t_(terrortmdifftpycompat(t
stringutiltCantReprocessAndShowBasecB@seZRS((t__name__t
__module__(((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyRscC@s�|d|dkst�|d|dks4t�t|d|d�}t|d|d�}||krx||fSdSdS(sGiven 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)
    iiN(tAssertionErrortmaxtmintNone(tratrbtsatsb((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt	intersect"s
cC@sp||||krtSxQttj||�tj||��D]$\}}||||kr@tSq@WtSdS(s?Compare a[astart:aend] == b[bstart:bend], without slicing.
    N(tFalsetzipRtxrangetTrue(tatastarttaendtbtbstarttbendtiatib((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt
compare_range8st
Merge3Textc
B@sqeZdZdddd�Zdddddddded�	Zd�Zd�Zd�Z	d	�Z
d
�ZRS(s�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.cC@s�||_||_||_|dkr9tj|�}n|dkrWtj|�}n|dkrutj|�}n||_||_||_dS(N(	tbasetexttatexttbtextRRt
splitnewlinestbaseRR(tselfR R!R"R$RR((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt__init__Is					s<<<<<<<s=======s>>>>>>>c
c@sJt|_d}
t|j�dkre|jdjd�rCd}
qe|jdjd�red}
qen|r�|r�|d|}n|r�|r�|d|}n|r�|r�|d|}n|j�}|	r�|j|�}nxc|D][}|d}
|
dkr4x<t|d|d�D]}|j|VqWq�|
d	ksL|
d
kr}x�t|d|d�D]}|j|VqdWq�|
dkr�x�t|d|d�D]}|j	|Vq�Wq�|
dkr6|d
krx^t|d|d�D]}|j|Vq�WqB|dkr@x!t|d|d�D]}|j	|Vq'WqBt
|_|dk	ra||
Vnx+t|d|d�D]}|j|VqyW|dk	r�||
Vx.t|d|d�D]}|j|Vq�Wn|dk	r�||
Vnx+t|d|d�D]}|j	|VqW|dk	rB||
VqBq�t|
��q�WdS(s'Return merge in cvs-like form.
        s
is
s
t t	unchangediiRtsameRtconflicttlocaliitotheriiN(
Rt	conflictstlenRtendswitht
merge_regionstminimizetrangeR$RRRt
ValueError(R%tname_atname_bt	name_basetstart_markert
mid_markert
end_markertbase_markertlocalorotherR1tnewlineR0tttwhatti((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pytmerge_linesWsd		

		cc@sx|j�D]}|d}|dkrI||j|d|d!fVq
|dksa|dkr�||j|d|d!fVq
|dkr�||j|d|d!fVq
|dkr||j|d|d!|j|d	|d
!|j|d|d!fVq
t|��q
Wd
S(s�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.
        iR(iiRR)RR*iiiiN(R0R$RRR3(R%R=R>((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pytmerge_groups�s
   cc@sPd}}}x;|j�D]-}|\}}}}}	}
||}|dksUt�|||kskt�||
|	ks�t�||}|	|}
||}|dks�t�|
dks�t�|dks�t�|s�|
r�t|j|||j||�}t|j||	|j||�}t|j|||j||	�}|r[d||fVns|ry|ryd||	fVnU|r�|r�d||fVn7|r�|r�d||||||	fVntd��|}|	}n|}|dkr||kst�||	kst�||ks%t�d||fV|}|}|
}qqWdS(	s�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.
        iR)RRR*s#can't handle a=b=base but unmatchedR(N(tfind_sync_regionsR	RRR$R(R%tizRRtregiontzmatchtzendtamatchRtbmatchRtmatchlentlen_atlen_btlen_basetequal_atequal_bR)((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyR0�sP





	c	c@s�xz|D]r}|ddkr(|Vqn|\}}}}}}}	||}
|	|}d}xH||
kr�||kr�|j|||j||kr�|d7}q`W|}
d}xP||
kr||kr|j||d|j|	|dkr|d7}q�W|}|
dkr.d|||
fVnd||||
||||
|	|fV|dkrd|||fVqqWdS(s
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.
        iR*iR)N(RR(R%R0RDtissuetz1tz2ta1ta2tb1tb2talentblentiitstartmatchest
endmatches((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyR1s0


"*	cC@sed}}tj|j|j�}tj|j|j�}t|�}t|�}g}x�||kr||kr||\}}	}
||\}}}
t|||
f|||
f�}|r�|d}|d}||}||
ks�t�||
kst�||kst�||ks(t�|	||}|||}||}||}|j||!|j	||!ks�t|j||!|j	||!f��|j||!|j
||!ks�t�|j||||||f�n||
||
kr|d7}q[|d7}q[Wt|j�}t|j	�}t|j
�}|j||||||f�|S(s�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.
        ii(Rtget_matching_blocksR R!R"R.RR	R$RRtappend(R%RRtamatchestbmatchesRJRKtsltabaseRGRVtbbaseRHRWR?tintbasetintendtintlentasubtbsubRR((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyRB:sH
#




##&
c	C@s�tj|j|j�}tj|j|j�}g}x�|r�|r�|dd}||dd}|dd}||dd}t||f||f�}|r�|j|�n||kr�|d=q9|d=q9W|S(s8Return a list of ranges in base that are not conflicted.ii(RR[R R!R"RR\(	R%tamtbmtuncRRRSRTRUR?((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pytfind_unconflictedws
N(RRt__doc__RR&RR@RAR0R1RBRj(((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyRDs 8	"	Y	'	=cC@sptj|�rltd�|}|jd�sH|jtd�|�n|jd�sltj|��qln|S(sUverifies that text is non-binary (unless opts[text] is passed,
    then we just warn)s%s looks like a binary file.tquietswarning: %s
ttext(RtbinaryRtgettwarnRtAbort(Rmtpathtuitoptstmsg((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt_verifytext�scC@s\t|�dkr*tjtd���n|}x$t|�D]\}}|||<q>W|S(Niscan only specify three labels.(R.RRqRt	enumerate(tdefaultst	overridestresultR?toverride((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt_picklabels�sc@s�tj�����fd�}�jdd�}d\}}}	|dkr�t|j�|j�dg�jdg��\}}}	ny(||�}
||�}||�}Wntjk
r�dSXt||
|�}
i�jdd�d6t	d6}|dkr)d|d	<d|d
<d|d<n-|	dk	rVd|d
<|	|d<t
|d<nd}xX|
jd|d|tj|��D]2}�jd�r��j
j|�q�||7}q�W�jd�s�|j||j��n|
jr�|dkr�dSdS(s[Performs the simplemerge algorithm.

    The merged result is written into `localctx`.
    c@st|j�|j����S(N(RvtdecodeddataRr(tctx(RtRs(s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pytreadctx�stmodetmergetuniontlabeliR;R1R7R8R9s|||||||R:R6tR4R5tprintN(NNN(RtbyteskwargsRoRR|RrRRqRRRR@t	strkwargstfouttwritetflagsR-(RstlocalctxtbasectxtotherctxRtRR�R4R5R6t	localtextR t	othertexttm3textrakwargst
mergedtexttline((RtRss;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pytsimplemerge�sH
!






N(t
__future__Rti18nRR�RRRtutilsRt	ExceptionRRRtobjectRRvR|R�(((s;/usr/lib64/python2.7/site-packages/mercurial/simplemerge.pyt<module>s		�M