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: //proc/self/root/lib64/python2.7/site-packages/mercurial/mdiff.pyo
�
1�3\c@@s�ddlmZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZddl
mZdZe
jd�Ze
jd	�ZejZejZejZejZejZejZd
efd��YZe�Zed�Zd
�Zd�Zd�Z dd�Z"dddd�Z#ed�Z$ed�Z%d�Z&d�Z'd�Z(d�Z)d�Z*d�Z+dS(i(tabsolute_importNi(t_(tencodingterrortpolicytpycompattutil(tdateutils\ No newline at end of file
tbdifftmpatchtdiffoptscB@s�eZdZidd6ed6ed6ed6ed6ed6ed6d	d
6ed6ed6ed
6ed6ed6ed6ed6ed6Zd�Zd�ZRS(scontext is the number of context lines
    text treats all files as text
    showfunc enables diff -p output
    git enables the git extended patch format
    nodates removes dates from diff headers
    nobinary ignores binary files
    noprefix disables the 'a/' and 'b/' prefixes (ignored in plain mode)
    ignorews ignores all whitespace changes in the diff
    ignorewsamount ignores changes in the amount of whitespace
    ignoreblanklines ignores changes whose lines are all blank
    upgrade generates git diffs to avoid data loss
    itcontextttexttshowfunctgittnodatestnobinarytnoprefixitindextignorewstignorewsamounttignorewseoltignoreblanklinestupgradetshowsimilaritytworddifftxdiffcK@s�tj|�}xR|jj�D]A}|j|�}|dkrP|j|}nt|||�qWyt|j�|_Wn6t	k
r�t
jtd�tj
|j���nXdS(Ns3diff context lines count must be an integer, not %r(RtbyteskwargstdefaultstkeystgettNonetsetattrtintRt
ValueErrorRtAbortRtbytestr(tselftoptstktv((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt__init__Es
c@sEt�fd��jD��}tj|�}|j|�t|�S(Nc3@s$|]}|t�|�fVqdS(N(tgetattr(t.0R'(R%(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pys	<genexpr>Us(tdictRRt	strkwargstupdateR
(R%tkwargsR&((R%s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytcopyTs
(t__name__t
__module__t__doc__tFalseRR)R0(((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyR
$s(
	cC@s�|jrtj|d�}n|jr<tj|d�}n|rl|jrltjdd|�jd�}n|jr�tjdd|�}n|S(Niis
+s
s[ \t\r\f]+\ns\n(	RRtfixwsRRtretsubtstripR(R&Rtblank((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytwsclean\s		!	c
c@s�g|D]!}t||�r"dp%d^q}g|D]!}t||�rPdpSd^q5}dt|�}}dt|�}}	xE||ks�||	kr�||d}
}}|
|ks�||
dks�||	ks�||dkrLd}x*|
|kr||
dkr|
d7}
q�Wxt||	krH||dkrH|d7}qWnGxD|
|kr�||
dkr�||dkr�|
d7}
|d7}qOW||||
||||g|fV|
}|}q�WdS(Niit=t~(R:tlen(
tbase1tlines1tbase2tlines2R&tlts1te1ts2te2ti1ti2tbtype((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt
splitblockgs&../
'cC@s2|\}}|\}}|||ko1||kS(s�Return True if `hunk` defined as (start, length) is in `linerange`
    defined as (lowerbound, upperbound).

    >>> hunkinrange((5, 10), (2, 7))
    True
    >>> hunkinrange((5, 10), (6, 12))
    True
    >>> hunkinrange((5, 10), (13, 17))
    True
    >>> hunkinrange((5, 10), (3, 17))
    True
    >>> hunkinrange((5, 10), (1, 3))
    False
    >>> hunkinrange((5, 10), (18, 20))
    False
    >>> hunkinrange((5, 10), (1, 5))
    False
    >>> hunkinrange((5, 10), (15, 27))
    False
    ((thunkt	linerangetstarttlengtht
lowerboundt
upperbound((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pythunkinrange�sc
C@s�|\}}d\}}g}x|D]}|\\}}	}
}}||
kr�||kr�|dkr�||
|}||
|}n�|
|ko�|knr�|dkr�|	||}q�|}n|
|ko�|knr
|dkr|||
}q
|	}nt|
||
f|�r%|j|�q%q%W|dks[|dks[||krstjtd���n|||ffS(s�filter `blocks` like (a1, a2, b1, b2) from items outside line range
    `rangeb` from ``(b1, b2)`` point of view.

    Return `filteredblocks, rangea` where:

    * `filteredblocks` is list of ``block = (a1, a2, b1, b2), stype`` items of
      `blocks` that are inside `rangeb` from ``(b1, b2)`` point of view; a
      block ``(b1, b2)`` being inside `rangeb` if
      ``rangeb[0] < b2 and b1 < rangeb[1]``;
    * `rangea` is the line range w.r.t. to ``(a1, a2)`` parts of `blocks`.
    R;sline range exceeds file sizeN(NN(RRQtappendRR#R(
tblockstrangebtlbbtubbtlbatubatfilteredblockstblockta1ta2tb1tb2tstype((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt
blocksinrange�s*
$		$cC@s;|dks)|js)tjtd�r0tjStjSdS(Ntxdiffblocks(RRRtsafehasattrRRSRa(R&((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytchooseblocksfunc�scc@s�|d	krt}n|js0|js0|jrWt||t�}t||t�}nt|�||�}xWt|�D]I\}}|dkr�||d}nddddg}|d|d|d|dg}|d|dks�|d|dkr�d}	|j	r�|d	kr(t
|�}n|d	krCt
|�}nt|dj||d|d!��}
t|dj||d|d!��}|
|kr�d}	q�n||	fVn|dfVqyWd	S(
sbReturn (block, type) tuples, where block is an mdiff.blocks
    line entry. type is '=' for blocks matching exactly one another
    (bdiff blocks), '!' for non-matching blocks and '~' for blocks
    matching only after having filtered blank lines.
    line1 and line2 are text1 and text2 split with splitnewlines() if
    they are already available.
    iiiit!tR<R;N(RtdefaultoptsRRRR:R4Rct	enumerateRt
splitnewlinestjoin(ttext1ttext2R&R?RAtdifftiRCtsttypetoldtnew((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt	allblocks�s0	"(	''c@sFd�fd�}gdf}	|r0|r0|	S�jrFd}
}nd}
d}tjd�}tj|�}tj|�}|r�|r�|r�t|�t|�kr�||kr�|	Sg}
dd|gff}nd|s�|jd�}t|�}|dkrd||�}nd	|
||||�f}d
|||||�f}||g}
t|�}ddd|f}d|gg|D]}d
|^q�}|r�|dcd7<|j	t
�n||ff}n`|s�|jd�}t|�}d	|
||||�f}|dkr9d||�}nd|||||�f}||g}
t|�}d|ddf}d|gg|D]}d|^q�}|r�|dcd7<|j	t
�n||ff}n]t||d��}t|�s|	Sd	|
||||�fd|||||�fg}
|
|fS(s|Return a unified diff as a (headers, hunks) tuple.

    If the diff is not null, `headers` is a list with unified diff header
    lines "--- <original>" and "+++ <new>" and `hunks` is a generator yielding
    (hunkrange, hunklines) coming from _unidiff().
    Otherwise, `headers` and `hunks` are empty.

    Set binary=True if either a or b should be taken as a binary file.
    c@s6�jr�jrd|S|r2d|kr2dSdS(Ns	%st s	Re(RR(tdatetfn(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytdatetag�s
Resa/sb/isBinary file %s has changed
s
s--- /dev/null%ss
--- %s%s%ss+++ %s%sis@@ -0,0 +1,%d @@
t+i����s+++ /dev/null%ss
+++ %s%s%ss@@ -1,%d +0,0 @@
t-R&N((ii(
RRRtdatestrRtpconvertR=tendswithRhRRt_missing_newline_markert_unidifftnext(tatadtbtbdtfn1tfn2tbinaryR&Rvtsentineltaprefixtbprefixtepochtheaderlinesthunkstwithout_newlinetl1tl2tsizet	hunkrangetet	hunklines((R&s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytunidiff�sh
	
0((c#@s�t���t����fd���fd�}ddg��������fd�}d}d}t}x�t������D]�\}}	|\}
}}}
|	dkr�|	dkr�||
|||
7}q�q�ng}�|
|!}�||
!}||8}|
|8}
||
�}||�}d}|r�||d�jdkrs|}|d}|d	}q�|s�t}tVnx||�D]}|Vq�Wn|r�||d<|
|d	<|d
}n||||
|g}g�||
!D]}d|^q�|t|�)g|D]}d|^q|t|�)g|D]}d
|^q>|t|�)q�W|r�|s|t}tVnx*||�D]}|Vq�Wn|s�tVndS(s�Yield hunks of a headerless unified diff from t1 and t2 texts.

    Each hunk consists of a (hunkrange, hunklines) tuple where `hunkrange` is a
    tuple (s1, l1, s2, l2) representing the range information of the hunk to
    form the '@@ -s1,l1 +s2,l2 @@' header and `hunklines` is a list of lines
    of the hunk combining said header followed by line additions and
    deletions.

    The hunks are prefixed with a bool.
    c@s&|�j}||kr"|}n|S(N(R(RBR=tret(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt
contextendOs
	c@s!|�j}|dkrdS|S(Ni(R(RBR�(R&(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytcontextstartUs
iRec3@s�|\}}}}}�|t���}||}||||}d}	�jr��\}
}	xztj|d|
dd�D][}�|dd!j�rd�|j�}	tj|	�r�|	d }	n|	�d<PqqW|�d<n|r�|d7}n|r|d7}n||||f}d||	fg|gtj||�D]}
d�|
^qK}t}�j	d�r||t��dkrx�tjt|�ddd�D]]}||j
d�r�||j
d�r�t}n||cd7<|j|dt
�Pq�q�Wn|r��j	d�r�||t��dkr�xetjt|�ddd�D]A}||j
d
�rk||cd7<|j|dt
�PqkqkWn||fVdS(NReii����iRsi)s@@ -%d,%d +%d,%d @@%s
s
RxRw(RxRs(R=R
RtxrangetisalnumtrstripRt
isasciistrR4R{t
startswithtTruetinsertR|(RKtastartR\tbstartR^tdeltataendtalentblentfunctlastposRmR�txR�tskip(R�R�R�tlastfuncR&tt1tt2(s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt	yieldhunk\sJ
	$




C*&	1&RdR<iiiRsRxRwN(RhRR4RrRR�R=(R�R�R&R�R�RKtignoredlinest	has_hunksRnR_R[R\R]R^R�RpRqR�R�tprevR�((R�R�R�R�R&R�R�s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyR}Bsb!@%








.'+cC@s�d�}dd�}|dkr*d}n|dkr?d}n||krOdSg}|jd�|jdt|��x0|tj|��D]}|j||��q�W|jd�dj|�S(	s print base85-encoded binary diffcS@sst|�}|dkr8tjtd�|d�}n!tj|dtd�d�}d|tj|t�fS(NitAiRs%c%s
(R=RtbytechrtordRt	b85encodeR�(tlineRB((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytfmtline�s
 !i4cs@sCt|�}d}x*||kr>||||!V||7}qWdS(Ni(R=(RtcsizeRBRm((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytchunk�s
ResGIT binary patch
sliteral %d
s
N(RRRR=tzlibtcompressRi(ttottnR�R�R�RB((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytb85diff�s			

cC@s�d}g}xh|t|�krvtjd|||d!�\}}}|d7}|j||||!�||7}qWdj|�S(Nis>llliRe(R=tstructtunpackRRRi(tbintpostttp1tp2RB((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt	patchtext�s&
cC@s5t|�dkr"tj|d�Stj||g�S(Nii(R=RtbufferR	tpatches(RR�((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytpatchscC@s@gtj||�D])}|d|d|d|df^qS(Niii(RRS(RR�td((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytget_matching_blocksscC@s |rtjddd|�SdS(Ns>llliRe(R�tpack(RN((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyttrivialdiffheaderscC@stjdd||�S(Ns>llli(R�R�(toldlentnewlen((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pytreplacediffheaders(,t
__future__RR6R�R�ti18nRReRRRRRtutilsRR|t	importmodRR	RSR5R�tpatchedsizettextdiffRhtobjectR
RfR�R:RJRQR`RRcRrR�R}R�R�R�R�R�R�(((s5/usr/lib64/python2.7/site-packages/mercurial/mdiff.pyt<module>s>(						6				')Q�	#