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 :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/mdiff.cpython-39.pyc
a

�+�bE�@s<ddlmZddlZddlZddlZddlmZddlmZm	Z	ddl
mZmZm
Z
mZmZmZddlmZe�d�Ze�d	�ZejZejZejZejZejZejZGd
d�de�Ze�Zd)d
d�Zdd�Zdd�Z dd�Z!d*dd�Z"d+dd�Z#efdd�Z$efdd�Z%dd�Z&dd �Z'd!d"�Z(d#d$�Z)d%d&�Z*d'd(�Z+dS),�)�absolute_importN�)�_)�getattr�setattr)�
diffhelper�encoding�error�policy�pycompat�util)�dateutil�bdiff�mpatchc@sJeZdZdZdZddddddddddddddddd�Zdd�Zd	d
�ZdS)�diffoptsacontext 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
    T�Fr)scontextstextsshowfuncsgitsnodatessnobinarysnoprefixsindexsignorewssignorewsamountsignorewseolsignoreblanklinessupgradesshowsimilaritysworddiffsxdiffc	Ks�t�|�}|j��D],}|�|�}|dur4|j|}t|||�qzt|j�|_Wn,ty~t	�
td�t�|j���Yn0dS)Ns3diff context lines count must be an integer, not %r)
rZbyteskwargs�defaults�keys�getr�int�context�
ValueErrorr	�
InputErrorrZbytestr)�self�opts�k�v�r�5/usr/lib64/python3.9/site-packages/mercurial/mdiff.py�__init__Ls



��zdiffopts.__init__cs6�fdd��jD�}t�|�}|�|�tfi|��S)Ncsi|]}|t�|��qSr)r)�.0r�rrr�
<dictcomp>]�z!diffopts.copy.<locals>.<dictcomp>)rrZ	strkwargs�updater)r�kwargsrrr!r�copy\s

z
diffopts.copyN)�__name__�
__module__�__qualname__�__doc__Z_HAS_DYNAMIC_ATTRIBUTESrrr&rrrrr)s*
�rTcCs\|jrt�|d�}n|jr&t�|d�}|rD|jrDt�dd|��d�}|jrXt�dd|�}|S)Nrrs
+�
s[ \t\r\f]+\ns\n)	�ignorewsr�fixws�ignorewsamount�ignoreblanklines�re�sub�strip�ignorewseol)r�textZblankrrr�wscleanfs
r5c#s4�fdd�|D�}�fdd�|D�}dt|�}}dt|�}}||ksR||k�r0||d}	}
}|	|ks�||	dks�|
|ks�||
dkr�d}|	|kr�||	dkr�|	d7}	q�|
|kr�||
dkr�|
d7}
q�n8|	|k�r||	dk�r||
dk�r|	d7}	|
d7}
q�||||	||||
g|fV|	}|
}q@dS)Ncsg|]}t�|�rdpd�qS�rr�r5�r �l�rrr�
<listcomp>ur#zsplitblock.<locals>.<listcomp>csg|]}t�|�rdpd�qSr6r7r8r:rrr;vr#r�=�~r��len)Zbase1�lines1Zbase2�lines2r�s1�e1�s2�e2Zi1Zi2Zbtyperr:r�
splitblockrs$(
&
"rFcCs$|\}}|\}}|||ko"||kS)a�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
    r)�hunkZ	linerange�start�lengthZ
lowerboundZ
upperboundrrr�hunkinrange�srJc
Cs|\}}d\}}g}|D]�}|\\}}	}
}}||
kr^||kr^|dkr^||
|}||
|}nd|
|krr|kr�nn|dkr�|	||}n|}|
|kr�|kr�nn|dkr�|||
}n|	}t|
||
f|�r|�|�q|dus�|dus�||k�rt�td���|||ffS)a�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`.
    )NNr<Nsline range exceeds file size)rJ�appendr	rr)
�blocksZrangebZlbbZubbZlbaZubaZfilteredblocks�block�a1�a2�b1�b2�styperrr�
blocksinrange�s*rScCs*|dus|jrt�td�s tjStjSdS)Nsxdiffblocks)ZxdiffrZsafehasattrrrLZxdiffblocksr:rrr�chooseblocksfunc�s��
�rTc	csD|durt}|js|js|jr6t||d�}t||d�}t|�||�}t|�D]�\}}|dkrj||d}ngd�}|d|d|d|dg}|d|dks�|d|dk�r4d}	|j�r*|dur�t|�}|dur�t|�}t|d	�	||d|d���}
t|d	�	||d|d���}|
|k�r*d
}	||	fV|dfVqLdS)abReturn (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.
    NFrr)rrrrr��!r#r=r<)
�defaultoptsr,r.r3r5rT�	enumerater/�
splitnewlines�join)Ztext1Ztext2rr@rA�diff�irB�s�type�old�newrrr�	allblocks�s0"  

racs^d�fdd�	}gdf}	|s"|s"|	S�jr2d}
}nd}
d}t�d�}t�|�}t�|�}|r�|r�|r�t|�t|�kr�||kr�|	Sg}
dd	|gff}�n�|�sV|�d
�}t|�}|dur�d||�}nd|
||||�f}d
|||||�f}||g}
t|�}ddd|f}d|gdd�|D�}|�rH|dd
7<|�t	j
�||ff}�n|�s|�d
�}t|�}d|
||||�f}|du�r�d||�}nd|||||�f}||g}
t|�}d|ddf}d|gdd�|D�}|�r|dd
7<|�t	j
�||ff}nDt||�d�}t|��s.|	Sd|
||||�fd|||||�fg}
|
|fS)a|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.
    Ncs(�js�jsd|S|r$d|vr$dSdS)Ns	%s� �	r#)�gitZnodates)�date�fnr:rr�datetags
zunidiff.<locals>.datetagrr#sa/sb/)rrsBinary file %s has changed
r+s--- /dev/null%ss
--- %s%s%ss+++ %s%srrs@@ -0,0 +1,%d @@
cSsg|]}d|�qS��+r�r �errrr;4r#zunidiff.<locals>.<listcomp>���s+++ /dev/null%ss
+++ %s%s%ss@@ -1,%d +0,0 @@
cSsg|]}d|�qS��-rrjrrrr;Dr#r:)N)
Znoprefixr
ZdatestrrZpconvertr?�endswithrYrKr�MISSING_NEWLINE_MARKER�_unidiff�next)�aZad�bZbdZfn1Zfn2Zbinaryrrg�sentinelZaprefixZbprefixZepochZheaderlinesZhunksZwithout_newline�l1�l2�size�	hunkrange�	hunklinesrr:r�unidiffsj



 

�r{c#s�t���t����fdd���fdd�}ddg��������fdd�}d	}d}d
}t������D�]X\}}	|\}
}}}
|	dkr�|	dkrd||
|||
7}qdg}�|
|�}�||
�}||8}|
|8}
||
�}||�}d	}|�r:||d
�jd
k�r|}|d
}|d}n&|�s$d}dV||�D]}|V�q,|�rZ||d
<|
|d<|d}n||||
|g}dd��||
�D�|t|�d	�<dd�|D�|t|�d	�<dd�|D�|t|�d	�<qd|�r�|�s�d}dV||�D]}|V�q�n|�s�d
Vd	S)a�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.
    cs|�j}||kr|}|S)N�r)r9r?�retr:rr�
contextendds
z_unidiff.<locals>.contextendcs|�j}|dkrdS|S�Nrr|)r9r}r:rr�contextstartjs
z_unidiff.<locals>.contextstartrr#c3s|\}}}}}�|t���}||}||||}d}	�jr��\}
}	t�|d|
dd�D]J}�|dd���r\d�|��}	t�|	�r�|	dd�}	|	�d<q�q\|�d<|r�|d7}|r�|d7}||||f}d||	fg|�fdd	�t�||�D�}
d
}��d��s�||t��dk�r�t�t|
�ddd�D]R}|
|�	d��r>|
|�	d��rfd
}|
|d7<|
�
|dtj��q��q>|�s��d��s||t��dk�rt�t|
�ddd�D]>}|
|�	d��r�|
|d7<|
�
|dtj��q�q�||
fVdS)Nr#rrlrrb�)s@@ -%d,%d +%d,%d @@%s
csg|]}d�|�qS�rbr�r �x)rvrrr;�r#z/_unidiff.<locals>.yieldhunk.<locals>.<listcomp>Fr+)rnrbTri)
r?ZshowfuncrZxrange�isalnum�rstriprZ
isasciistrro�
startswith�insertrrp)rG�astartrO�bstartrQ�deltaZaend�alenZblen�funcZlastposr\ryrz�skip�r~rvrwZlastfuncr�t1�t2rr�	yieldhunkrsT
���
"
(
z_unidiff.<locals>.yieldhunkNFrVr=rrT�cSsg|]}d|�qSr�rr�rrrr;�r#z_unidiff.<locals>.<listcomp>cSsg|]}d|�qSrmrr�rrrr;�r#cSsg|]}d|�qSrhrr�rrrr;�r#)rYrarr?)r�r�rr�r�rGZignoredlinesZ	has_hunksr]rRrNrOrPrQr�r_r`r�r��prevr�rr�rrqVsb@


"rqcCs�dd�}ddd�}|durd}|dur*d}||kr6dSg}|�d�|�d	t|��|t�|��D]}|�||��qd|�d
�d�|�S)z print base85-encoded binary diffcSsVt|�}|dkr(t�td�|d�}nt�|dtd�d�}d|t�|d�fS)N��Ar�as%c%s
T)r?rZbytechr�ordrZ	b85encode)�liner9rrr�fmtline�s
zb85diff.<locals>.fmtline�4css4t|�}d}||kr0||||�V||7}qdSrr>)r4Zcsizer9r\rrr�chunk�s
zb85diff.<locals>.chunkNr#sGIT binary patch
sliteral %d
r+)r�)rKr?�zlib�compressrZ)�to�tnr�r�r}r9rrr�b85diff�s


r�cCsdd}g}|t|�krZt�d|||d��\}}}|d7}|�||||��||7}qd�|�S)Nr�>lll�r#)r?�struct�unpackrKrZ)�bin�pos�tZp1Zp2r9rrr�	patchtexts
r�cCs&t|�dkrt�|d�St�||g�S)Nrr�)r?r�bufferr�patches)rsr�rrr�patchsr�cCsdd�t�||�D�S)NcSs*g|]"}|d|d|d|df�qS)rrUrr)r �drrrr;$r#z'get_matching_blocks.<locals>.<listcomp>)rrL)rsrtrrr�get_matching_blocks#sr�cCs|rt�ddd|�SdS)Nr�rr#�r��pack)rIrrr�trivialdiffheader'sr�cCst�dd||�S)Nr�rr�)ZoldlenZnewlenrrr�replacediffheader+sr�)T)N)NNN),Z
__future__rr0r�r�Zi18nrrrr�rrr	r
rZutilsr
Z	importmodrrrLr-r�ZpatchedsizeZtextdiffrY�objectrrWr5rFrJrSrTrar{rqr�r�r�r�r�r�rrrr�<module>s@ 

:
(

*S%

Youez - 2016 - github.com/yon3zu
LinuXploit