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__/patch.cpython-39.opt-1.pyc
a

�+�b���
@sjddlmZmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZmZmZ ddl!m"Z"m#Z#m$Z$m%Z%ej&Z&e�'d	�Z(e�'d
�Z)e�'d�Z*ej+Z+ej,Z,ej-Z-dd
�Z.gd�Z/ej0dd��Z1dd�Z2Gdd�de3�Z4dd�Z5Gdd�de3�Z6Gdd�de3�Z7Gdd�de7�Z8Gdd�de8�Z9Gdd �d e3�Z:Gd!d"�d"e7�Z;e�'d#�Z<e�'d$�Z=gd%�Z>Gd&d'�d'e3�Z?Gd(d)�d)e3�Z@Gd*d+�d+e3�ZAd,d-�ZBd}d.d/�ZCGd0d1�d1e3�ZDGd2d3�d3e3�ZEd4d5�ZFd6d7�ZGd~d8d9�ZHd:d;�ZId<d=�ZJd>d?�ZKd@dA�ZLdBdC�ZMdDdE�ZNddHdI�ZOdJdK�ZPd�dLdM�ZQdNdO�ZRd�dPdQ�ZSd�dRdS�ZTd�dTdU�ZUd�dVdW�ZVd�dXdY�ZWGdZd[�d[eX�ZYejZZ[ejZZZej\Z\d�d\d]�Z]d�d^d_�Z^d`da�Z_dbdc�Z`ddde�Zadfdg�Zbdhdi�Zcdjdk�Zddldmdndo�Zedpdq�Zfdrds�Zgdtdu�Zhdvdw�Zid�dydz�Zjd{d|�ZkdS)��)�absolute_import�print_functionN���_)�hex�sha1nodeconstants�short)�open)
�copies�
diffhelper�diffutil�encoding�error�mail�mdiff�pathutil�pycompat�scmutil�similar�util�vfs)�dateutil�hashutil�procutil�
stringutilsdiff --git a/(.*) b/(.*)s(\t+|[^\t]+)s9(\t+| +|[a-zA-Z0-9_\x80-\xff]+|[^ \ta-zA-Z0-9_\x80-\xff])csdd��dd���fdd�}�fdd�}�fd	d
�}��fdd�}�fd
d�}Gdd�dt�}d}g}dg}	t�|d�s�||�}|D]�}
|�|
�|
�d�r�|||�S|
�d�r�|||�S�|
|�r�d}|
�dd�d��|	vr�|||�Sq�|
�d�r�|r�|||�Sq�||�S)z6return an iterator of individual patches from a streamcSsD|r|�d�rdS|�d�r dS|�dd�}t|�dkoBd|d	vS)
N)� �	T)r�-�+F�: r�rr)�
startswith�split�len)�line�inheader�l�r(�5/usr/lib64/python3.9/site-packages/mercurial/patch.py�isheaderCs
zsplit.<locals>.isheadercSstd�|��S�N�)�stringio�join)�linesr(r(r)�chunkMszsplit.<locals>.chunkc3sVd}|D]:}|��sd}|s8|�d�r8�|�Vg}d}|�|�q|rR�|�VdS)NTF�# HG changeset patch)�stripr"�append��stream�curr&r%�r0r(r)�hgsplitPs
zsplit.<locals>.hgsplitc3sj|D]<}|�d�r6t�|dd���D]
}|Vq&g}|�|�q|rft�|dd���D]
}|VqZdS)N�From r)r"r#r3)r5r6r%�cr7r(r)�	mboxsplit`s
zsplit.<locals>.mboxsplitc	3stdd�}|D]}|�|�q�|�}t�|�}|��sB||�Vn.d}|��D] }|��}||vrdqN||�VqNdS)NcSs,t�}tj|dd�}|�|�|�d�|S)NF)Zmangle_from_r)r-r�	GeneratorZflatten�seek)�m�fp�gr(r(r)�msgfpns


z'split.<locals>.mimesplit.<locals>.msgfp��
text/plainstext/x-diffstext/x-patch)r3r�parseZis_multipart�walk�get_content_type)	r5r6rAr%r:r>�ok_types�partZctr7r(r)�	mimesplitms	
zsplit.<locals>.mimesplitc3s\d}|D]@}|s,�||�r,�|�Vg}d}|r>�||�s>d}|�|�q|rX�|�VdS�NFT�r3r4�r0r*r(r)�headersplit�s
zsplit.<locals>.headersplitc3s�|�VdS�Nr()r6r7r(r)�	remainder�szsplit.<locals>.remainderc@s(eZdZdd�Zdd�Zdd�ZeZdS)zsplit.<locals>.fitercSs
||_dSrN)r?��selfr?r(r(r)�__init__�szsplit.<locals>.fiter.__init__cSs|SrNr(�rQr(r(r)�__iter__�szsplit.<locals>.fiter.__iter__cSs|j��}|st�|SrN)r?�readline�
StopIteration�rQr'r(r(r)�next�s
zsplit.<locals>.fiter.nextN)�__name__�
__module__�__qualname__rRrTrX�__next__r(r(r(r)�fiter�sr]Fscontent-typesnextr1r9T�:rr�--- )�objectr�safehasattrr3r"r#�lower)r5r8r;rIrMrOr]r&r6Zmimeheadersr%r(rLr)r#@s4





r#))sDatesdate)sBranchsbranch)sNode ID�nodeidc	cs\tjdd�\}}t�|d�}z&t||||�VW|��t�|�n|��t�|�0dS)a�extract patch from data read from fileobj.

    patch can be a normal patch or contained in an email message.

    return a dictionary. Standard keys are:
      - filename,
      - message,
      - user,
      - date,
      - branch,
      - node,
      - p1,
      - p2.
    Any item can be missing from the dictionary. If filename is missing,
    fileobj did not contain a patch. Caller must unlink filename when done.�	hg-patch-��prefix�wbN)r�mkstemp�os�fdopen�_extract�close�unlink)�ui�fileobj�fd�tmpname�tmpfpr(r(r)�extract�s�rsc	Cs�t�dtjtjB�}i}t�|�}|do6t�|d�}|doLt�|d�|d<|sz|dszd�dd�|��D��d}g}|d}	|	r�t�|	�|d	<}	|�	d
|	�|r�|�
d�r�|�d�}
|
d
kr�||
dd���}t�
dd|�}|�	d|�|d�r|�	d|d�d
}d}d}
|��D�]}t�|���}|�	d|�||v�rZ�q*|jdd�}|�|�}|�rd}d}d}|�	d|�d
��|d7}t�}|d|�d
����D�],}|�
d��r�|�s�|�	d�d}d}|�d
�|��d}n�|�r�|�
d��r2|dd�|d<|�	d|d�n�|�
d��rV|�|dd����n`|�
d ��r�tD]H\}}d!|}|�
|��rf|t|�d�||<|�	d"|||f��qfnd}n|d#k�r�d}|�s�|�s�|�|�|�d��q�|��}
|�r<|�|�|�d��s<|�d�n"|�s*|
�r*|d$k�r*|
d|7}
�q*|�r^|
�
|��s^d%||
f}
|
|d&<|��|�r�|� d
�|d'<|�r�|� d
�|d(<|�r�||d)<|S)*Ns}^(?:Index:[ \t]|diff[ \t]-|RCS file: |retrieving revision [0-9]+(\.[0-9]+)*$|---[ \t].*?^\+\+\+[ \t]|\*\*\*[ \t].*?^---[ \t])ZSubjectZFromsuser�
css |]}d�ttj|��VqdS)r N)r.�maprZ
strtolocal��.0�hr(r(r)�	<genexpr>�sz_extract.<locals>.<genexpr>zX-Mercurial-NodercsNode ID: %s
s[PATCH�]rrs\n[ \t]+rsSubject: %s
s	From: %s
rBr,sContent-Type: %s
T)�decodeFsfound patch at byte %d
r1spatch generated by hg export
s# User �s	# Parent �	�# s# %s s%s: %s
�---rCs%s
%ssmessagesp1sp2sfilename)!�re�compile�	MULTILINE�DOTALLrrDZ
headdecoder.�items�debugr"�find�lstrip�subrEr�bytestrrFZget_payload�search�startr-�
splitlinesr=�truncater3�patchheadermapr$�write�getvalue�endswithrl�pop)rnrorqrr�diffre�data�msgZsubject�parentsZnodeidZpendZ
diffs_seenrG�messagerHZcontent_typeZpayloadr>ZhgpatchZ
hgpatchheaderZ
ignoretextZcfpr%�header�keyrfr(r(r)rk�s�
�

���









rkc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�	patchmetaa�Patched file metadata

    'op' is the performed operation within ADD, DELETE, RENAME, MODIFY
    or COPY.  'path' is patched file path. 'oldpath' is set to the
    origin file when 'op' is either COPY or RENAME, None otherwise. If
    file mode is changed, 'mode' is a tuple (islink, isexec) where
    'islink' is True if the file is a symlink and 'isexec' is True if
    the file is executable. Otherwise, 'mode' is None.
    cCs"||_d|_d|_d|_d|_dS)NsMODIFYF)�path�oldpath�mode�op�binary)rQr�r(r(r)rRes
zpatchmeta.__init__cCs|d@}|d@}||f|_dS)Ni �@)r�)rQr��islink�isexecr(r(r)�setmodelszpatchmeta.setmodecCs.t|j�}|j|_|j|_|j|_|j|_|SrN)r�r�r�r�r�r�)rQ�otherr(r(r)�copyqs
zpatchmeta.copycCs&|dkr|jdkS|d|jp |jkS)N�	/dev/null�ADD�a/)r�r�r�)rQ�afiler(r(r)�_ispatchingays
zpatchmeta._ispatchingacCs |dkr|jdkS|d|jkS)Nr��DELETE�b/�r�r�)rQ�bfiler(r(r)�_ispatchingb~s
zpatchmeta._ispatchingbcCs|�|�o|�|�SrN)r�r�)rQr�r�r(r(r)�
ispatching�szpatchmeta.ispatchingcCsd|j|jfS)Nz<patchmeta %s %r>r�rSr(r(r)�__repr__�szpatchmeta.__repr__N)rYrZr[�__doc__rRr�r�r�r�r�r�r(r(r(r)r�Zs
r�cCsrd}g}|D�]N}|�d�}|�d�rVt�|�}|rT|rB|�|�|�d�}t|�}q|r|�d�rt|�|�d}q|�d�r�d|_|dd�|_q|�d	�r�|d
d�|_	q|�d�r�d|_|d
d�|_q|�d
�r�|dd�|_	q|�d�r�d|_q|�d��r&d|_|�
t|dd�d��q|�d��rL|�
t|dd�d��q|�d�rd|_q|�rn|�|�|S)z9extract git-style metadata about patches from <patchname>N�
�
diff --git a/r!r_srename from �RENAME�s
rename to �
s
copy from �COPYscopy to �sdeleted filer�snew file mode r�i����s	new mode �GIT binary patchT)
�rstripr"�gitre�matchr3�groupr�r�r�r�r��intr�)�lr�gp�
gitpatchesr%r>�dstr(r(r)�readgitpatch�sL















r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
linereadercCs||_g|_dSrN)r?�bufrPr(r(r)rR�szlinereader.__init__cCs|dur|j�|�dSrN)r�r3�rQr%r(r(r)�push�szlinereader.pushcCs&|jr|jd}|jd=|S|j��S�Nr)r�r?rUrWr(r(r)rU�s

zlinereader.readlinecCst|jd�Sr+)�iterrUrSr(r(r)rT�szlinereader.__iter__N)rYrZr[rRr�rUrTr(r(r(r)r��sr�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�abstractbackendcCs
||_dSrN)rn)rQrnr(r(r)rR�szabstractbackend.__init__cCst�dS)z�Return target file data and flags as a (data, (islink,
        isexec)) tuple. Data is None if file is missing/deleted.
        N��NotImplementedError�rQ�fnamer(r(r)�getfile�szabstractbackend.getfilecCst�dS)a	Write data to target file fname and set its mode. mode is a
        (islink, isexec) tuple. If data is None, the file content should
        be left unchanged. If the file is modified after being copied,
        copysource is set to the original file name.
        Nr��rQr�r�r��
copysourcer(r(r)�setfile�szabstractbackend.setfilecCst�dS)zUnlink target file.Nr�r�r(r(r)rm�szabstractbackend.unlinkcCsdS)z�Write rejected lines for fname. total is the number of hunks
        which failed to apply and total the total number of hunks for this
        files.
        Nr()rQr��failed�totalr/r(r(r)�writerej�szabstractbackend.writerejcCst�dSrNr�r�r(r(r)�exists�szabstractbackend.existscCst�dSrNr�rSr(r(r)rl�szabstractbackend.closeN)
rYrZr[rRr�r�rmr�r�rlr(r(r(r)r��sr�csDeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
�	fsbackendcs tt|��|�t�|�|_dSrN)�superr�rR�vfsmodr�opener)rQrnZbasedir��	__class__r(r)rR�szfsbackend.__init__c
Cs�|j�|�r|j�|�dfSd}z|j�|�jd@dk}Wn2tyl}z|jtjkrX�WYd}~n
d}~00z|j�|�d|ffWSt	y�}z|jtjkr��WYd}~dSd}~00dS)N�TFFr�r�NN)
r�r��readlink�lstat�st_mode�OSError�errno�ENOENT�read�IOError)rQr�r��er(r(r)r��szfsbackend.getfilecCs^|\}}|dur$|j�|||�dS|r8|j�||�n"|j�||�|rZ|j�|dd�dSrJ)r�Zsetflags�symlinkr�)rQr�r�r�r�r�r�r(r(r)r�szfsbackend.setfilecCs$|j�dd�}|jj|d|d�dS)NsexperimentalsremoveemptydirsT)Z
ignoremissing�rmdir)rnZ
configboolr�Z
unlinkpath)rQr�r�r(r(r)rmszfsbackend.unlinkcCsD|d}|j�td�|||f�|�|d�}|�|�|��dS)Ns.rejs7%d out of %d hunks FAILED -- saving rejects to file %s
�w)rn�warnrr��
writelinesrl)rQr�r�r�r/r?r(r(r)r�s��
zfsbackend.writerejcCs|j�|�SrN)r��lexistsr�r(r(r)r�szfsbackend.exists)
rYrZr[rRr�r�rmr�r��
__classcell__r(r(r�r)r��s
r�csDeZdZ�fdd�Zdd�Z�fdd�Z�fdd�Zd	d
�Z�ZS)�workingbackendcs:tt|��||j�||_||_t�|_t�|_g|_	dSrN)
r�r�rR�root�repo�
similarity�set�removed�changed�copied)rQrnr�r�r�r(r)rR$szworkingbackend.__init__cCs.|jj�|�js*|�|�r*ttd�|��dS�Ns$cannot patch %s: file is not tracked)r��dirstateZ	get_entryZany_trackedr��PatchApplicationErrorrr�r(r(r)�_checkknown,s�
�zworkingbackend._checkknowncsH|�|�tt|��||||�|dur8|j�||f�|j�|�dSrN)r�r�r�r�r�r3r��addr�r�r(r)r�4s

zworkingbackend.setfilecs6|�|�tt|��|�|j�|�|j�|�dSrN)r�r�r�rmr�r�r�r�r�r(r)rm;s
zworkingbackend.unlinkcCs�|jd}t|j�}|jD]\}}t�|j|j|||�q|jrr|�t	|j��|jD]}||jj
vrV|�|�qV|r�t�|j||j
�t	|j�SrN)r�r�r�r�rZdirstatecopyrnr�Zforget�sortedr��discard�marktouchedr�)rQZwctxr��srcr��fr(r(r)rlAs


zworkingbackend.close)	rYrZr[rRr�r�rmrlr�r(r(r�r)r�#s
r�c@s0eZdZd
dd�Zddd�Zdd�Zdd	�ZdS)�	filestoreNcCs8d|_i|_d|_||_|jdur(d|_d|_i|_dS)Nri@)r��files�created�maxsize�sizer�)rQrr(r(r)rRUs
zfilestore.__init__cCs�|jdkst|�|j|jkrB|||f|j|<|jt|�7_nX|jdurdtjdd�}t�|�|_d|j	}|j�
||�|j	d7_	|||f|j|<dS)Nrrdre�%dr)rr$rr�r�rZmkdtempr�rrr�r)rQr�r�r�r�r��fnr(r(r)r�_s

zfilestore.setfilecCsJ||jvr|j|S|jr$||jvr(dS|j|\}}}|j�|�||fS)N)NNN)r�r�rr�)rQr�rr�r�r(r(r)r�ms

zfilestore.getfilecCs|jrt�|jj�dSrN)r��shutil�rmtree�baserSr(r(r)rluszfilestore.close)N)N)rYrZr[rRr�r�rlr(r(r(r)rTs


rcsLeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�repobackendcs<tt|��|�||_||_||_t�|_t�|_i|_	dSrN)
r�rrRr��ctx�storer�r�r�r�)rQrnr�r
rr�r(r)rR{szrepobackend.__init__cCs||jvrttd�|��dSr�)r
r�rr�r(r(r)r��s

�zrepobackend._checkknowncCsFz|j|}Wntjy$YdS0|��}|��d|vd|vffS)Nr��l�x)r
r�LookupError�flagsr�)rQr��fctxrr(r(r)r��szrepobackend.getfilecCsT|r|�|�|dur$|j|��}|j�||||�|j�|�|rP||j|<dSrN)r�r
r�rr�r�r�r�r�r(r(r)r��s
zrepobackend.setfilecCs|�|�|j�|�dSrN)r�r�r�r�r(r(r)rm�s
zrepobackend.unlinkcCs
||jvSrN)r
r�r(r(r)r��szrepobackend.existscCs|j|jBSrN)r�r�rSr(r(r)rl�szrepobackend.close)rYrZr[rRr�r�r�rmr�rlr�r(r(r�r)rzs	
rs*@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@s.(?:---|\*\*\*) (\d+)(?:,(\d+))? (?:---|\*\*\*))�strict�crlf�lf�autoc@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�	patchfilerc
Cs�|j|_||_d|_||_||_g|_d|_d|_|j	|_	|j
|_|jdv|_
|jdk|_|jdurv|�|j�\}}n|�|j�dd�\}}|du�rX|jdup�|�|j�|_d|_|r�t�|�|_|j	dur�||_	|j�rx|jd�d�r�d|_n|jd�d��rd|_|d	k�rxg}|jD],}	|	�d��rB|	dd
�d}	|�|	��q"||_n |j
�rfd|_|j	du�rxd|_	|j�r�|j�td�|j�|j�td
��i|_d|_d|_d|_g|_d|_|�d�d|_dS)NFT)r�r�r�r�r!rr�rtr���)FFs!unable to find '%s' for patching
sB(use '--prefix' to apply patch relative to the current directory)
)r�r��eolmode�eol�backendrnr/r��missingr�r�r�r��create�remover�r�
splitnewlinesr�r3r�r�hash�dirty�offset�skew�rej�fileprinted�	printfile�hunks)
rQrnr�rrrr�r��nlinesr'r(r(r)rR�sj




��
zpatchfile.__init__cCs�|jdkr|j}n|jdkr"d}nd}|jdkrv|rv|dkrvg}|D],}|rf|�d�rf|dd�|}|�|�qD|}|j�|d�|�||j�dS)Nrrr�rtr���r,)rrr�r3rr�r.r�)rQr�r/r�rZrawlinesr'r(r(r)r��s

zpatchfile.writelinescCsL|jr
dS|s|jjrd|_td�|j}|r<|j�|�n|j�|�dS)NTspatching file %s
)r&rn�verboserr�r��note)rQr��sr(r(r)r'�szpatchfile.printfilecs2|j�|g�}t|�dkr.|j�fdd�d�|S)Nrcst|��SrN)�abs)�x��linenumr(r)�<lambda>r,z%patchfile.findlines.<locals>.<lambda>)r�)r!�getr$�sort)rQr'r1�candr(r0r)�	findlinesszpatchfile.findlinescCs�|js
dStj�|j�}d||fg}|jD]:}|jD].}|�|�|dd�dkr6|�dtj�q6q,|j	�
|jt|j�|j|�dS)Ns--- %s
+++ %s
r*rt)
r%rir��basenamer��hunkr3r�MISSING_NEWLINE_MARKERrr�r$r()rQrr/r/r'r(r(r)�	write_rejs


zpatchfile.write_rejc
Cs�|��s8ttd�|j|jt|j�|jt|j�|j	f��|j
d7_
|jr\|j�
|�dS|jr�|jr�|jr�|j�td�|j�n|j�td�|j�|j�
|�dSt|t��r|jr�|j�|j�n2|�|j�}||jdd�<|jt|�7_d|_dS|}|jdv�s(|jd	k�r0|j�r0|��}|� dd
�\}}}}||j7}|}|j!dk�r�t"�#||j|��r�|j�r�|j�|j�n6||j||t|��<|jt|�t|�7_d|_dSi|_$t%|j�D]\}	}
|j$�&|
g��
|	��q�t'�(|j�)dd�d�D�]J}d
D�]<}|� ||�\}}}}||j|j!}t*|t|j��}|�rn|�+|ddd�|�}
n|g}
|
D]�}|�r�t"�#||j|��rx||j||t|��<|jt|�t|�7_|||_!d|_|||}|�rtd�}|�,d�|j�||j|d||f�n$td�}|j�-||j|d|f�|S�qx�q�q
|�,d�|j�td�|j|f�|j�
|�dS)Nsbad hunk #%d %s (%d %d %d %d)rr*s-cannot create %s: destination already exists
sfile %s already exists
Tr)rrrF�patchsfuzzr�s9Hunk #%d succeeded at %d with fuzz %d (offset %d lines).
s,Hunk #%d succeeded at %d (offset %d lines).
sHunk #%d FAILED at %d
).�complete�PatchParseErrorr�number�descr$�a�lena�b�lenbr(rr%r3r�rr�rnr�r��
isinstance�binhunkrrrm�newr/r#r"rr�
getnormalized�fuzzitr$rZtesthunkr!�	enumerate�
setdefaultr�xrangeZ	configint�minr6r'r,)rQrxr'Zhorig�old�oldstartrF�newstartZ
orig_startr/r-Zfuzzlen�toponlyr5r#r�r(r(r)�apply"s�"�������
�


�
��
zpatchfile.applycCs,|jr|�|j|j|j�|��t|j�SrN)r"r�r�r/r�r:r$r%rSr(r(r)rl�szpatchfile.closeN)r)
rYrZr[rRr�r'r6r:rQrlr(r(r(r)r�s
<mrc@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
e�d�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)r�zpatch headersdiff --git a/(.*) b/(.*)$sdiff -r .* (.*)$s(?:index|deleted file) s(?:new file|deleted file) s'(?:index|deleted|copy|rename|new mode) s(?:new file|copy to|rename to)cCs||_g|_dSrN)r�r()rQr�r(r(r)rR�szheader.__init__cCstdd�|jD��S)Ncss|]}|�d�VqdS)�index N�r"rvr(r(r)ry�r,z header.binary.<locals>.<genexpr>��anyr�rSr(r(r)r��sz
header.binarycCs�|jD]�}|�d�r&|�td��q�|j�|�rV|�|�|��rR|�td��q�|�d�r�|�td�t|j�t	dd�|jD��f�q�|�|�qdS)NrRs-this modifies a binary file (all or nothing)
sthis is a binary file
rs%d hunks, %d lines changed
cSsg|]}t|j|j��qSr()�max�addedr�rvr(r(r)�
<listcomp>�r,z!header.pretty.<locals>.<listcomp>)
r�r"r�r�	pretty_rer�r�r$r(�sum)rQr?rxr(r(r)�pretty�s&



���z
header.prettycCs|�d�|j��dSr+)r�r.r�rPr(r(r)r��szheader.writecst�fdd��jD��S)Nc3s|]}�j�|�VqdSrN)�allhunks_rer�rvrSr(r)ry�r,z"header.allhunks.<locals>.<genexpr>rTrSr(rSr)�allhunks�szheader.allhunkscCsR|j�|jd�}|r8|��\}}||kr0|gS||gS|j�|jd���SdSr�)�
diffgit_rer�r��groups�diff_re)rQr��fromfile�tofiler(r(r)r�szheader.filescCs|��dS)Nr*)rrSr(r(r)�filename�szheader.filenamecCsdd�t�tj|����S)Nz<header %s>� )r.rZrapply�fsdecoderrSr(r(r)r��s�zheader.__repr__cst�fdd��jD��S)Nc3s|]}�j�|�VqdSrN)�
newfile_rer�rvrSr(r)ry�r,z#header.isnewfile.<locals>.<genexpr>rTrSr(rSr)�	isnewfile�szheader.isnewfilecs6t�j�dk}���o|}|p4t�fdd��jD��S)Nr!c3s|]}�j�|�VqdSrN)�
special_rer�rvrSr(r)ry�sz!header.special.<locals>.<genexpr>)r$r�rgrU)rQZ	nocontentZemptynewfiler(rSr)�special�s
�zheader.specialN)rYrZr[r�r�r�r^r`r\rYrhrfrRr�r[r�r]rrcr�rgrir(r(r(r)r��s"






r�c@s\eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e	Z
dd�Zej
dd��ZdS)�
recordhunkzKpatch hunk

    XXX shouldn't we merge this with the other hunk class?
    Nc	sld�fdd�	}	||_|	|d�\}
|_||
|_||
|_|	|d�\}|_||_||_|�|j�\|_|_	dS)NFcsH�dur@t|��}|dkr@|r0|||d�fS||d��fSd|fSr��r$)r/�reverse�delta��
maxcontextr(r)�trimcontext�sz(recordhunk.__init__.<locals>.trimcontextT)F)
r��before�fromline�toline�after�procr8�countchangesrWr�)rQr�rrrsrurqr8rtrorpZtrimedbeforeZ_trimedafterr(rnr)rR�s


zrecordhunk.__init__cCsFt|t�sdS|j|jkoD|j|jkoD|j|jkoD|j��|j��kS)NF)rDrjr8rurrr�r)rQ�vr(r(r)�__eq__
s

�
��zrecordhunk.__eq__cCs$tt|j�t|j���|j|jf�SrN)r!�tupler8r�rrrrurSr(r(r)�__hash__s��zrecordhunk.__hash__cCs,tdd�|D��}tdd�|D��}||fS)zhunk -> (n+,n-)cSsg|]}|�d�r|�qS)rrSrvr(r(r)rX!r,z+recordhunk.countchanges.<locals>.<listcomp>cSsg|]}|�d�r|�qS)rrSrvr(r(r)rX"r,rk)rQr8r�Zremr(r(r)rvszrecordhunk.countchangescs@dddd���fdd�|jD�}t|j|j|j|j|j||j�S)z�return another recordhunk which is the reverse of the hunk

        If this hunk is diff(A, B), the returned hunk is diff(B, A). To do
        that, swap fromline/toline and +/- signs while keep other things
        unchanged.
        rr�\)rrr{cs,g|]$}d�|dd�|dd�f�qS)s%s%srrNr()rwr'�r>r(r)rX-r,z*recordhunk.reversehunk.<locals>.<listcomp>)r8rjr�rsrrrurqrt�rQr8r(r|r)�reversehunk%s�zrecordhunk.reversehunkc	Cs�t|j�t|j�}|jr2|jdtjkr2|d8}||j}||j}|�d|j||j	||j
ofd|j
f�|�d�|j|j|j��dS)Nr*rs@@ -%d,%d +%d,%d @@%s
rr,)
r$rqrtrr9r�rWr�rrrsrur.r8)rQr?rmZfromlenZtolenr(r(r)r�8s 

���
zrecordhunk.writecCs
|j��SrN)r�rcrSr(r(r)rcLszrecordhunk.filenamecCsd|��|jfS)Ns<hunk %r@%d>)rcrrrSr(r(r)r�Oszrecordhunk.__repr__)N)rYrZr[r�rRrxrzrvr~r�r[rcrZ	strmethodr�r(r(r(r)rj�s�

rjcCsZtd�td�td�td�d�td�td�td�td	�d�td
�td�td�td
�d�d�S)Nsapply change %d/%d to '%s'?sdiscard change %d/%d to '%s'?skeep change %d/%d to '%s'?srecord change %d/%d to '%s'?)sapplysdiscardskeep�recordsapply this change to '%s'?sdiscard this change to '%s'?skeep this change to '%s'?srecord this change to '%s'?s0[Ynesfdaq?]$$ &Yes, apply this change$$ &No, skip this change$$ &Edit this change manually$$ &Skip remaining changes to this file$$ Apply remaining changes to this &file$$ &Done, skip remaining changes and files$$ Apply &all changes to all remaining files$$ &Quit, applying no changes$$ &? (display help)s8[Ynesfdaq?]$$ &Yes, discard this change$$ &No, skip this change$$ &Edit this change manually$$ &Skip remaining changes to this file$$ Discard remaining changes to this &file$$ &Done, skip remaining changes and files$$ Discard &all changes to all remaining files$$ &Quit, discarding no changes$$ &? (display help)s-[Ynesfdaq?]$$ &Yes, keep this change$$ &No, skip this change$$ &Edit this change manually$$ &Skip remaining changes to this file$$ Keep remaining changes to this &file$$ &Done, skip remaining changes and files$$ Keep &all changes to all remaining files$$ &Quit, keeping all changes$$ &? (display help)s4[Ynesfdaq?]$$ &Yes, record this change$$ &No, skip this change$$ &Edit this change manually$$ &Skip remaining changes to this file$$ Record remaining changes to this &file$$ &Done, skip remaining changes and files$$ Record &all changes to all remaining files$$ &Quit, recording no changes$$ &? (display help))�multiple�single�helprr(r(r(r)�getmessagesTs0��������r�cs�t���durd����fdd�}t�}i}d\}}dtdd�|D��}	}
|D�]}|	t|j�7}	d}d	}d
�|j�}
|
|vr�qP|�|
�|dur�|���|�	�}t
d�t
d��d
d�|D��}t�fdd�|D��r�d\}}}n||||d�\}}}}|�sqP|g||��<|�
��r6||��|j7<qPt|j�D�]\}}|du�rh|du�rh|���|
dk�r��d�|��}n,|	t|j�|}�d�||
|��f}|||||�\}}}}|�r|�r�t�|�}|j|7_||���|�n\|du�rN|D]:}|jD],}|�r2|j|7_||���|��q�qn||j|j7}�q@qPtdd�t�|�D�g�ifS)z:Interactively filter patch chunks into applied-only chunksNrc	s�d}|dur||||fS|dur,||||fS�d�}��d||f�}��d�|dkr���|�dD] \}}��d|t�|�f�qjq,�n"|dkr�d	}	�n|dkr�d
}	�n|dk�rL|durވ�td����d�q,|j���r��td
����d�q,dtd�}
tj	ddd�\}}d}
�zt
�t�
|d��}|j�|�|�|�|�d�dd�|
��D���|�����}�jd||fd���idd�}	|	dk�r̈�td�|	�Wt�|�~
q,t|d�}t�}
t
�|�D]&}t
�|�}|�d��s�|
�|��q�|��|
�d�t|
�}Wt�|�~
nt�|�~
0d
}	nh|dk�r`d
}	}nT|dk�rtd	}	}n@|d k�r�d
}	}n,|d!k�r�d	}	}n|d"k�r�t�td#���|	|||fS)$z�prompt query, and process base inputs

        - y/n for the rest of file
        - y/n for the rest
        - ? (help)
        - q (quit)

        Return True/False and possibly updated skipfile and skipall.
        Nr�s%s
(enter ? for help) %srtr�rs%s - %s
rTFr!s cannot edit patch for whole files!cannot edit patch for binary filers�
To remove '-' lines, make them ' ' lines (context).
To remove '+' lines, delete them.
Lines starting with # will be removed from the patch.

If the patch applies cleanly, the edited hunk will immediately be
added to the record list. If it does not apply cleanly, a rejects
file will be generated: you can use that when you try again. If
all lines of the hunk are removed, then the edit is aborted and
the hunk is left unchanged.
s
hg-editor-s.diff)rf�suffixrgr,cSsg|]}d|d�qS)r~rtr()rw�ir(r(r)rX�r,z/filterpatch.<locals>.prompt.<locals>.<listcomp>s%s "%s"sHGUSERsfilterpatch)�environZ
blockedtags editor exited with exit code %d
�rb�#����r|s	user quit)Zpromptchoicer�Zextractchoicesrrbrr�r�rrhrZnativeeolwriterrirjr.r�rlZ	geteditor�system�usernamer�rmr
r-�iterfileZ
fromnativeeolr"r=�
parsepatchrZ
CanceledError)�skipfile�skipall�queryr0�
newpatchesZresps�rr:�t�retZphelpZpatchfdZpatchfnZ	ncpatchfprZeditorZpatchfpr%)�messages�	operationrnr(r)�prompt�s�




�
�

��

�

�




�









zfilterpatch.<locals>.promptr�rcss|]}t|j�VqdSrN)r$r(rvr(r(r)ryr,zfilterpatch.<locals>.<genexpr>rr,sexamine changes to %s?s and css|]}d|VqdS)s'%s'Nr(�rwrr(r(r)rysc3s|]}��|�VqdSrN)�exactr��r�r(r)ryr,)TNNr�r�cSs(g|] }|d��s t|�dkr|�qS)rr)rir$rvr(r(r)rXBs�zfilterpatch.<locals>.<listcomp>)r�r�rZr$r(r.r�r�r[rr�allrcr]rIr�rsr3r�rWrZ
itervalues)rn�headersr�r�r��seenZappliedr�r��posr�rxZ	fixoffset�hdrrr�r�Znpr�r0�idxr�ZnewpatchZnewhunkr()r�r�r�rnr)�filterpatch�s�j


�




��


���r�c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)r8cCs^||_||_|g|_g|_g|_d|_|_d|_|_|durZ|rP|�	|�n
|�
|�dSrN)r>r?r8r@rB�startarA�startbrC�read_context_hunk�read_unified_hunk)rQr?Znumr��contextr(r(r)rRNsz
hunk.__init__cCsndd�}t|j|jdd�}|j|_|j|_|j|_||j�|_||j�|_|j|_|j|_|j|_|j|_|S)z1Return a copy with line endings normalized to LF.cSs6g}|D](}|�d�r&|dd�d}|�|�q|S)Nr�rrt)r�r3)r/r)r%r(r(r)�	normalize_s
z%hunk.getnormalized.<locals>.normalizeN)	r8r?r>r@rBr�r�rArC)rQr�Znhr(r(r)rG\s	zhunk.getnormalizedc
CsFt�|j�}|s"ttd�|j��|��\|_|_|_	|_
|jdurLd|_nt|j�|_|j
durjd|_
nt|j
�|_
t|j�|_t|j	�|_	z"t�
||j|j|j
|j|j�Wn<tjy�}z"ttd�|j|f��WYd}~n
d}~00t|jd�dk�r8|jd=|jd=|jd=|jd8_|j
d8_
q�|�|�dS)N�bad hunk #%drsbad hunk #%d: %sr*r)�unidescr�r?r=rr>r_r�rAr�rCr�rZaddlinesr8r@rBrZ
ParseErrorr$�_fixnewline)rQr�r>r�r(r(r)r�ts2

�,zhunk.read_unified_hunkcCs�|��|_t�|j�}|s,ttd�|j��|��\|_}t	|j�|_|durT|j}t	|�|j|_
|jrx|j
d7_
t�|j
�D]�}|��}|�
d�r�|�|��q|dd�}|�
d�s�|�
d�r�d|}n*|�
d�r�d	|}nttd
�|j|f��|j�|�|j�|�q�|��}|�
d��rZ|jddd�}||jd<||jd<|��}t�|�}|�s|ttd�|j��|��\|_}t	|j�|_|du�r�|j}t	|�|j|_|j�r�|jd7_d}	t�|j�D�]J}|��}|�
d��r$|jddd�}||jd<||j|	d<�q�|�s:|�|��q*|dd�}|�
d
��s^|�
d��rhd|}nN|�
d��r~d	|}n8t|j�dk�r�|�|��q*nttd
�|j|f��|j�|�|	t|j�k�r�d}
n
|j|	}
|	d7}	|
|k�r��q�n(|
�
d��r�q�n|j�|	d|��qܐqq�|j�sd|jD]*}|�
d��sT|�
d	��r8|j�|��q8|j�s�|jD]2}|�
d��s�|�
d	��rr|j�|dd���qrd|j|j
|j|jf|_|j|jd<|�|�dS)Nr�rrr!s- s! rs  rsbad hunk #%d old text line %d�\ r*s+ rrr,s@@ -%d,%d +%d,%d @@
)rUr?�contextdescr�r=rr>r_r�r�rArrKr"r�r@r3r8r�rCrBr$�insertr�)rQr�r>Zaendr/r'r-�uZbendZhunkirxr(r(r)r��s�





�








�



�zhunk.read_context_hunkcCs6|��}|�d�r(t�|j|j|j�n
|�|�dS)Nr�)rUr"rZ
fixnewliner8r@rBr�)rQr�r'r(r(r)r�s
zhunk._fixnewlinecCs t|j�|jkot|j�|jkSrN)r$r@rArBrCrSr(r(r)r<sz
hunk.completec	Cs�t|t|��}|r�d}d}t|j�}t�|d�D]&}|j|d�d�rT|d7}q2qZq2|s�t�|d�D]*}|j||d�d�r�|d7}qlq�qlt||�}t||�}||t|�|�||t|�|�|fS||dfS)Nrrr)rLr$r8rrKr")	rQrMrF�fuzzrP�topZbotZhlenr/r(r(r)�_fuzzit
s$




*zhunk._fuzzitcCsf|�|j|j||�\}}}|j|}|j|}|jrD|dkrD|d8}|jrZ|dkrZ|d8}||||fS)Nrr)r�r@rBr�r�rArC)rQr�rPrMrFr�rNrOr(r(r)rH%s

zhunk.fuzzitN)rYrZr[rRrGr�r�r�r<r�rHr(r(r(r)r8Msmr8c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rEzA binary patch file.cCs(d|_d|_dg|_||_|�|�dS)NFsGIT binary patch
)�textrmr8�_fname�_read)rQr�r�r(r(r)rR4s
zbinhunk.__init__cCs
|jduSrN)r�rSr(r(r)r<;szbinhunk.completecCs"|jrt|jd�|��gS|jgSr+)rm�
applybindeltar�r.)rQr/r(r(r)rF>szbinhunk.newc	
Cs�dd�}|||j�}|s*ttd�|j��|�d�rJt|dd����}qr|�d�rt|dd����}d|_qrqg}|||j�}t|�d	k�rL|d
d	�}|dkr�|dkr�t	|�t	d�d	}nt	|�t	d
�d}z$|�
t�|d	d��d|��WnBt
�y<}z(ttd�|jt�|�f��WYd}~n
d}~00|||j�}q�t�d�|��}t|�|k�r�ttd�|jt|�|f��||_dS)NcSs|��}|�|�|�d�S)Nr�)rUr3r�)r�r8r'r(r(r)�getlineDs
zbinhunk._read.<locals>.getlines"could not extract "%s" binary datasliteral r�sdelta r�Trr�Z�A�a�s&could not decode "%s" binary patch: %sr,s%"%s" length is %d bytes, should be %d)r8r=rr�r"r�r�rmr$�ordr3rZ	b85decode�
ValueErrorr�forcebytestr�zlib�
decompressr.r�)	rQr�r�r%rZdecr'r�r�r(r(r)r�CsJ�

$����z
binhunk._readN)rYrZr[r�rRr<rFr�r(r(r(r)rE1s
rEcCsF|dd��d�}|�d�}|dkr:|�d�}|dkr:|S|d|�S)Nr�r�rrr)r�r�)�strr-r�r(r(r)�
parsefilenameos

r�cCs0g}|D]"}t�|d�r |��}|�|�q|S)a�reverse the signs in the hunks given as argument

    This function operates on hunks coming out of patch.filterpatch, that is
    a list of the form: [header1, hunk1, hunk2, header2...]. Example usage:

    >>> rawpatch = b"""diff --git a/folder1/g b/folder1/g
    ... --- a/folder1/g
    ... +++ b/folder1/g
    ... @@ -1,7 +1,7 @@
    ... +firstline
    ...  c
    ...  1
    ...  2
    ... + 3
    ... -4
    ...  5
    ...  d
    ... +lastline"""
    >>> hunks = parsepatch([rawpatch])
    >>> hunkscomingfromfilterpatch = []
    >>> for h in hunks:
    ...     hunkscomingfromfilterpatch.append(h)
    ...     hunkscomingfromfilterpatch.extend(h.hunks)

    >>> reversedhunks = reversehunks(hunkscomingfromfilterpatch)
    >>> from . import util
    >>> fp = util.stringio()
    >>> for c in reversedhunks:
    ...      c.write(fp)
    >>> fp.seek(0) or None
    >>> reversedpatch = fp.read()
    >>> print(pycompat.sysstr(reversedpatch))
    diff --git a/folder1/g b/folder1/g
    --- a/folder1/g
    +++ b/folder1/g
    @@ -1,4 +1,3 @@
    -firstline
     c
     1
     2
    @@ -2,6 +1,6 @@
     c
     1
     2
    - 3
    +4
     5
     d
    @@ -6,3 +5,2 @@
     5
     d
    -lastline

    sreversehunk)rrar~r3)r(Znewhunksr:r(r(r)�reversehunkszs8r�c	s�G�fdd�dt�}|�}t�}|�d�|��|�d�d}t|�D]H\}}z|j||||�Wn"ty�td||f��Yn0|}qF~|�	�S)aDpatch -> [] of headers -> [] of hunks

    If maxcontext is not None, trim context lines if necessary.

    >>> rawpatch = b'''diff --git a/folder1/g b/folder1/g
    ... --- a/folder1/g
    ... +++ b/folder1/g
    ... @@ -1,8 +1,10 @@
    ...  1
    ...  2
    ... -3
    ...  4
    ...  5
    ...  6
    ... +6.1
    ... +6.2
    ...  7
    ...  8
    ... +9'''
    >>> out = util.stringio()
    >>> headers = parsepatch([rawpatch], maxcontext=1)
    >>> for header in headers:
    ...     header.write(out)
    ...     for hunk in header.hunks:
    ...         hunk.write(out)
    >>> print(pycompat.sysstr(out.getvalue()))
    diff --git a/folder1/g b/folder1/g
    --- a/folder1/g
    +++ b/folder1/g
    @@ -2,3 +2,2 @@
     2
    -3
     4
    @@ -6,2 +5,4 @@
     6
    +6.1
    +6.2
     7
    @@ -8,1 +9,2 @@
     8
    +9
    cs�eZdZdZdd�Zdd�Z�fdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
eeeed�eeee	d�eeed�eed�de	id�ZdS)zparsepatch.<locals>.parserzpatch parsing state machinecSs4d|_d|_d|_d|_g|_g|_g|_g|_dS)Nrr,)rrrsrur�r�rqr8r�rSr(r(r)rR�sz#parsepatch.<locals>.parser.__init__cSs6|�g�|\}}}}}t|�|_t|�|_||_dSrN)�
addcontextr�rrrsru)rQZlimitsZ	fromstartZfromendZtostartZtoendrur(r(r)�addrange�s



z#parsepatch.<locals>.parser.addrangec	s�|jrvt|j|j|j|j|j|j|��}|jj�|�|jt	|j�|j
7_|jt	|j�|j7_g|_g|_||_dSrN)
r8rjr�rrrsrurqr(r3r$r�rWr�)rQr�rxrnr(r)r��s"�
z%parsepatch.<locals>.parser.addcontextcSs.|jr|j|_g|_|jr$|�g�||_dSrN)r�rqr8r�r}r(r(r)�addhunk
s
z"parsepatch.<locals>.parser.addhunkcSs(|�g�t|�}|j�|�||_dSrN)r�r�r�r3)rQr�rxr(r(r)�newfiles
z"parsepatch.<locals>.parser.newfilecSsdSrNr(r�r(r(r)�addothersz#parsepatch.<locals>.parser.addothercSs|�g�|jSrN)r�r�rSr(r(r)�finisheds
z#parsepatch.<locals>.parser.finished)�context�file�hunk�range)r�r�r��other)r�r�r�)r�r�r�)r�r�r�r�r�N)rYrZr[r�rRr�r�r�r�r�r��transitionsr(rnr(r)�parser�s2
����r�r,rr�sunhandled transition: %s -> %s)
r`r-r�r.r=�	scanpatchr��KeyErrorr=r�)Zoriginalchunksror��pr?�stateZnewstater�r(rnr)r��s ,R

�
r�cCs�t|�}d}|dkr$d||��fS|}|dkr�|�d|�}|dkrZttd�|||f��|d7}||dkr�|||d�dkr�|d7}qb|d8}q(|d|���|||d���fS)a�turn a path from a patch into a path suitable for the repository

    prefix, if not empty, is expected to be normalized with a / at the end.

    Returns (stripped components, path in repository).

    >>> pathtransform(b'a/b/c', 0, b'')
    ('', 'a/b/c')
    >>> pathtransform(b'   a/b/c   ', 0, b'')
    ('', '   a/b/c')
    >>> pathtransform(b'   a/b/c   ', 2, b'')
    ('a/b/', 'c')
    >>> pathtransform(b'a/b/c', 0, b'd/e/')
    ('', 'd/e/a/b/c')
    >>> pathtransform(b'   a//b/c   ', 2, b'd/e/')
    ('a//b/', 'd/e/c')
    >>> pathtransform(b'a/b/c', 3, b'')
    Traceback (most recent call last):
    PatchApplicationError: unable to strip away 1 of 3 dirs from a/b/c
    rr,�/r*s*unable to strip away %d of %d dirs from %srN)r$r�r�r�rr�)r�r2rf�pathlenr��countr(r(r)�
pathtransformJs$�� 

r�cCs�|dk}|dk}|o&|jdko&|jdk}|o>|jdko>|jdk}	t|||�\}
}|o^|�|�}t|||�\}
}||kr~|}n|o�|�|�}|o�|o�|}|d|�d�d�}|d|�d�d�}|r�||kr�|�|�r�|jdkr�|jdkr�d}d}|
|
k�o|�|�}d}|�sD|�r:|�r:|�r4|}n|}n
|�rD|}|�sz|�sb|�r\|}n|}n|�sn|}ntt	d���t
|�}|�r�d|_n|	�r�d	|_|S)
Nr�rr�rTFs&undefined source and destination filesr�r�)r�rAr�rCr�r��rfindr"r=rr�r�)rZ
afile_origZ
bfile_origr8r2rfZnullaZnullbrrZabaser�ZgoodaZbbaser�ZgoodbrZabasedirZbbasedirZisbackupr�r�r(r(r)�
makepatchmetass`�����r�c	#st�d�}t|���fdd�}t�jd�D]�}|�d�sB|�d�r�dd�}|||�}���}|�d	�r|���}|||g7}n
��|�d
|fVq*|�d�r�d�d
||�fdd��fVq*|�d�r�d�d||�fdd��fVq*|�|�}|�rd|��fVq*d|fVq*dS)z�like patch.iterhunks, but yield different events

    - ('file',    [header_lines + fromfile + tofile])
    - ('context', [context_lines])
    - ('hunk',    [hunk_lines])
    - ('range',   (-start,len, +start,len, proc))
    s'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)cs>|g}t�jd�D]&}||�r*|�|�q��|�q:q|S)zscan lr while predicate holdsr,)r�rUr3r�)�firstr�r/r%)r�r(r)�	scanwhile�s
zscanpatch.<locals>.scanwhiler,r�sdiff -r cSs|�dd�}|p|ddvS)Nrr)r�diff)r#)r%r-r(r(r)�	notheader�szscanpatch.<locals>.notheaderrr�r)rr{r�cs
|���SrNrS�r'��csr(r)r2�r,zscanpatch.<locals>.<lambda>)rr)rrr{r�cs
|���SrNrSr�r�r(r)r2�r,r�r�N)	r�r�r�r�rUr"r�r�r_)	r?Zlines_rer�r%r�r�rarbr>r()r�r�r)r��s.






r�cCsbd}z|j��}|j}Wn ty8t|j���}Yn0t|�}|�|�t|�}|�|�|S)a�
    Git patches can emit:
    - rename a to b
    - change b
    - copy a to c
    - change c

    We cannot apply this sequence as-is, the renamed 'a' could not be
    found for it would have been renamed already. And we cannot copy
    from 'b' instead because 'b' would have been changed already. So
    we scan the git patch for copy and rename commands so we can
    perform the copies ahead of time.
    r)	r?�tellr�r-r�r�r�r�r=)r��	firstliner�r?Zgitlrr�r(r(r)�scangitpatch�s



r�ccs�d}d}d}d}d}}d}d}d}	t|�}
t|
jd�D�]z}||k�r|	sV|�d�st|	durh|�d�st|�d��rd}|r�|d	�||�r�|��}|�d�r�t|
|j�}
n(|	dur�|�d�r�d
}	t||d|
|	�}
|d7}|�rd}d|||
|r�|�	�p�dffVd|
fV�n�|�d
��r�t
�|�d��}|�s6q8|du�rft
|
|�}ddd�|D�fV|��d|�d�}d|�d�}|�r�|d	�||��s�|��}dd|jd|jd|�	�ffV�q�|�s�ttd�|dd���d
}n�|�d��r2|
��}|�d��s|
�|�q8d
}d}	t|�}t|�}nn|�d��r�|
��}|�d��s^|
�|�q8|
��}|
�|�|�d��s�|
�|�q8d
}d
}	t|�}t|�}|r8d}d
}|}d}q8|�r�|��}dd|jd|jd|�	�ffV�q�dS)aDRead a patch and yield the following events:
    - ("file", afile, bfile, firsthunk): select a new target file.
    - ("hunk", hunk): a new hunk is ready to be applied, follows a
    "file" event.
    - ("git", gitchanges): current diff is in git format, gitchanges
    maps filenames to gitpatch records. Unique event.
    r,NrFr�@s***************r�r*Tr�r�r�r��gitcSsg|]}|jdvr|���qS))r�r�)r�r�)rwr@r(r(r)rX-sziterhunks.<locals>.<listcomp>r�r�r!s'failed to synchronize metadata for "%s"r�+++s***)r�r�rUr"r�r�rEr�r8r�r�r�r�r�rlr�r=rr�r�)r?r�r�r�ZhunknumZemitfiler�r�ZBFILEr�r�r/r�rxr>�l2�l3r(r(r)�	iterhunks�s�
�����


�
��




r�c
Csdd�}d}||�}||d�}||�}||d�}d}|t|�k�rt|||d��}|d7}|d@�r�d}d}|d@r�t|||d��}|d7}|d@r�|t|||d��d	>O}|d7}|d
@r�|t|||d��d>O}|d7}|d	@�r|t|||d��d>O}|d7}|d@�rDt|||d��}|d7}|d
@�rr|t|||d��d	>O}|d7}|d@�r�|t|||d��d>O}|d7}|dk�r�d}||}	||||	�7}q8|dk�r�||}	||||	�7}||7}q8ttd���q8|S)z_Apply a binary delta hunk
    The algorithm used is the algorithm from git's patch-delta.c
    cSs4d}t�|�D] }|d7}t|�d@s|Sq|S)Nrr�)rr�r�)�binchunkr�r:r(r(r)�	deltaheadjs
z applybindelta.<locals>.deltaheadr,Nrrr�r!r�r���� r�isunexpected delta opcode 0)r$r�r�r)
r�r�r��outr-r��cmdr#rZ
offset_endr(r(r)r�esX







r�r,rc
Cst||t|||||d�S)aNReads a patch from fp and tries to apply it.

    Returns 0 for a clean patch, -1 if any rejects were found and 1 if
    there was any fuzz.

    If 'eolmode' is 'strict', the patch content and patched file are
    read in binary mode. Otherwise, line endings are ignored when
    patching then normalized according to 'eolmode'.
    �r2rfr)�
_applydiffr)rnr?rrr2rfrr(r(r)�	applydiff�s
�r�cCs,|r(t�|j|��|�}|dkr(|d7}|S)Nr,r�)rZ	canonpathr��getcwd)r�rfr(r(r)�_canonprefix�s
r�cs�t|j�����fdd�}d}	d}
d}t|�D�]<\}}
|dkr^|sFq.|�|
�}|dkr\d}
q.|dk�r|r||	|��7}	d}|
\}}}}|r�||j�|_|jr�||j�|_nt||||���}|jdkr�|�	|j�|�s�|jdkr�|�	|j�q.d	\}}|jd
v�r:|�
|j�dd�\}}|du�r:ttd�|j��|j
�rX|j
}|jd
k�rXd}|�sb|r.|jdv�r�|�|j��r�ttd�|j��|�|j|||j�q.z||||||d�}WnRt�y}z8|�t�|�d�d}|	d7}	WYd}~q.WYd}~n
d}~00q.|dk�rZ|
D]8}||j�}|�
|�\}}|du�rFn|�|||��qq.t�td�|��q.|�r�|	|��7}	|	�r�dS|
S)Ncst|�d��dS)Nr)r�)r��rfr2r(r)�pstrip�sz_applydiff.<locals>.pstriprr�rr�r�r�r�)r�r�r!ssource file '%s' does not existr�r,)r�r�r�s,cannot create %s: destination already exists)rrtr��unsupported parser state: %sr*)r�r�r�rQrlr�r�r�r�rmr�r�rr�r�r��
PatchErrorr�rr�r�Abort)rnr?�patcherrrr2rfrr�Zrejects�errZcurrent_filer��valuesr�r�r��
first_hunkr�r�r��instr�r(r�r)r��s�

�


�
����$


r�cCs�d}g}|j}	|	r&|�dt�|	��d|d�|�|t�|�f}
|�d|
�t�|
d�}z�t�|�D]�}|�	�}|�
|d�|�d�r�t�|�}
d}|�
|
�qh|�d	�d
kr�d}|s�|�|
d�d}|�|d�qh|�d�d
kr�|�|d�qh|�d
�d
krh|�s"|�|
d�d}|�|d�qhW|�r`t�|||�n|�r^t�|||�0|��}|�r�ttd�t�|���|S)ztuse <patcher> to apply <patchname> to the working directory.
    returns whether patch was applied with fuzz factor.Fs-d %ss%s %s -p%d < %srsUsing external patch tool: %s
�rbrtspatching file s	with fuzzrTssaving rejects to filesFAILEDspatch command failed: %s)r�r3rZ
shellquoter.r��popenrr�r�r,r"Zparsepatchoutputr�r�r�rr�rlr�rZexplainexit)rnr�r��	patchnamer2rr�r��args�cwdr�r?r%ZpfZprinted_file�coder(r(r)�_externalpatch	sX�

��r
c

Cs�|durt�}|dur"|�dd�}|��tvr@t�td�|��|��}t�}zt|d�}Wnt	yr|}Yn0z@t
|||||||d�}	W||kr�|��|�|���|��n(||kr�|��|�|���|��0|	dkr�t
td���|	dkS)Nr;seols!unsupported line endings type: %srr�rspatch failed to apply)r��configrb�eolmodesrr�rrr
�	TypeErrorr�rl�updater�)
rnr�patchobjr2rfrrrr?r�r(r(r)�patchbackendN	s6
�
�
rc	Cs t|||�}t|||||||�S)zwuse builtin patch to apply <patchobj> to the working directory.
    returns whether patch was applied with fuzz factor.)r�r)	rnr�rr2rfrrr�rr(r(r)�
internalpatchl	src	
Cs"t||||�}	t||	|||||�SrN)rr)
rnr�r
rrr2rfrrrr(r(r)�	patchrepo|	src		CsH|�dd�}|durt�}|r2t|||||||�St||||||||�S)a�Apply <patchname> to the working directory.

    'eolmode' specifies how end of lines should be handled. It can be:
    - 'strict': inputs are read in binary mode, EOLs are preserved
    - 'crlf': EOLs are ignored when patching and reset to CRLF
    - 'lf': EOLs are ignored when patching and reset to LF
    - None: get it from user settings, default to 'strict'
    'eolmode' is ignored when using an external patcher program.

    Returns whether patch was applied with fuzz factor.
    suir;N)rr�r
r)	rnr�rr2rfrrr�r�r(r(r)�patch�	s��rc	Cst||j�}t||�}t|d���}t�}t|�D]�\}}	|dkr�|	\}
}}}
|
r�t|
j|d|�d|
_|
jr�t|
j|d|�d|
_nt	||
||||�}
|�
|
j�|
jdkr�|�
|
j�q0|dvr0t�
td�|��q0|Wd�S1�s�0YdS)Nrr�rr�)r�r�r�)r�r�r�r
r�r�r�r�r�r�r�r�rr�r)rnr�Z	patchpathr2rfrr?r�r�rr�r�rr�r(r(r)�changedfiles�	s0
���
rc@seZdZdS)�GitDiffRequiredN)rYrZr[r(r(r(r)r�	srccs�|s|s|j��}||}||}t||||||||||	d�
D]`\}
}}}|
dur\|
||�}d�dd�|D��}|r�|s�t|�dkr�d�|�dV|r>|Vq>dS)a�yields diff of changes to files between two nodes, or node and
    working directory.

    if node1 is None, use first dirstate parent instead.
    if node2 is None, compare node1 with working directory.

    losedatafn(**kwarg) is a callable run when opts.upgrade=True and
    every time some change cannot be represented with the current
    patch format. Return False to upgrade to git patch format, True to
    accept the loss or raise an exception to abort the diff. It is
    called with the name of current file being diffed as 'fn'. If set
    to None, patches will always be upgraded to git format when
    necessary.

    prefix is a filename prefix that is prepended to all filenames on
    display (used for subrepos).

    relroot, if not empty, must be normalized with a trailing /. Any match
    patterns that fall outside it will be ignored.

    copy, if not empty, should contain mappings {dst@y: src@x} of copy
    information.

    if copysourcematch is not None, then copy sources will be filtered by this
    matcher

    hunksfilterfn, if not None, should be a function taking a filectx and
    hunks generator that may yield filtered hunks.
    )	�ctx1�ctx2r��changes�opts�
losedatafn�pathfnr��copysourcematchNr,css|]\}}d�|�VqdS)r,N�r.)rwZhrangeZhlinesr(r(r)ry
r,zdiff.<locals>.<genexpr>rrt)r�Zp1�	diffhunksr.r$)r�Znode1Znode2r�rrrrr�rZ
hunksfilterfnrr�fctx1�fctx2r�r(r�r(r(r)�diff�	s.*
�
r!c

sN|durtj}dd�}
|
��|s.�j�|d�}t|t�rL|dd�\���
n|j|j|j���
�sr�sr�
srgS�jj	r�t
�nt��fdd�������fD���dur�i�|j
s�|jr�tj��|d���r�fdd	�t���D��t��}t��}t�
�}
�D]$}|�v�r|�|�|�|��q�
D]}|�v�r,|
�|��q,t|��t|��t|
��
t����D]\}}|�v�rl�|=�qlt��t||B|
B��}���|f���|fg}t��|��������	�
��f
d
d�}|j�r@|j
�s@z$�fdd
�}t||jdd�|��WSt�y<||jdd�d�YS0n
||d�SdS)z�Yield diff of changes to files in the form of (`header`, `hunks`) tuples
    where `header` is a list of diff headers and `hunks` is an iterable of
    (`hunkrange`, `hunklines`) tuples.

    See diff() for the meaning of parameters.
    Ncsi�t�����fdd�}|S)NcsX|j|��|�d�}|�vr@t��dkr2����=|���|<n
��|���|�|S)N)�filelog�)Zfilectxr3r$�popleftr"rr3)rr
r��cache�orderr(r)�
getfilectx,
s


z4diffhunks.<locals>.lrugetfilectx.<locals>.getfilectx)�collections�deque)r(r(r%r)�
lrugetfilectx(
sz diffhunks.<locals>.lrugetfilectxr�r�csg|]}|r�|��qSr(r()rw�node)�hexfuncr(r)rXM
r,zdiffhunks.<locals>.<listcomp>csi|]\}}�|�r||�qSr(r()rwr�r)rr(r)�
<dictcomp>W
s�zdiffhunks.<locals>.<dictcomp>c
st��	�������||��SrN)�trydiff)r�losedata)
rWr�rrr(�modifiedrr�r��revsr(r)�difffn}
s�zdiffhunks.<locals>.difffncs�r�|d�st�dS)N�r)rr4)rr(r)r0�
szdiffhunks.<locals>.losedataF)�gitT)rZdefaultopts�statusrD�listr1rWr�rnZ	debugflagrr	r,r5ZupgraderZ
pathcopiesrZ	iteritemsr�rr�r�r�rZ
matchfiles�revZ
prefetchfilesr�r)r�rrr�rrrrr�rr+Zmodifiedset�addedset�
removedsetrr�rZ
prefetchmatchZ
revmatchesr3r0r()
rWr�rrrr(r-rr1rr�r�r2r)r
sr
�

�




�

�rccs�|D]�}|�d�}|��}|�d�r*d}n|�d�r:d}nt�d|��t�|�D]$}|�d�rl|dfVqR||fVqR||kr�|t|�d	�d
fV||kr|t|�d	�dfVqd	S)z1yield tokens for a list of lines in a single hunkr�r�diff.deletedr�
diff.inserted�unexpected hunk line: %sr�diff.tabN�diff.trailingwhitespacer,)r�r"r�ProgrammingError�tabsplitter�findallr$)�	hunklinesr%Z	chompline�	stripline�label�tokenr(r(r)�diffsinglehunk�
s 



rGccs�t�}t�}|D]V}|dd�dkr6||dd�7}q|dd�dkrX||dd�7}qt�d|��q|rp|s�t|�D]
}|VqxdSt�t|��}t�t|��}dd�|D�}d	d�|D�}d
�|�}	d
�|�}
g}g}tj	|	|
||d�}
|
D]t\\}}}}}|dk}t�
d
�|||���D]}|�||f��q"t�
d
�|||���D]}|�||f��qPq�dd
|fdd|ffD�]\}}}d}|D]�\}}|�r�||fVd}|�d�}|�r|dd�}|�d��r�|dd�}|t
|�d�}|��}|t
|�d�}t�|�D]@}d|dd�k�r.d}n|�r>|d}n|d}||fV�q|�r�|�rj|dfV|d
fVd}�q��q|dS)zEyield tokens for a list of lines in a single hunk, with inline colorsrrrNrr=cSs g|]}|dkr|n|d�qS�rtr(�rwr-r(r(r)rX�
r,z(diffsinglehunkinline.<locals>.<listcomp>cSs g|]}|dkr|n|d�qSrHr(rIr(r(r)rX�
r,r,)Zlines1Zlines2�!r;r<TFrtr*�
rr>s.changeds
.unchangedr?)�	bytearrayrr@rG�wordsplitterrB�bytesr.rZ	allblocksr r3r�r$r�rA)rCr@rBr%r�ZalZblZalnZblnZanZbnZatokensZbtokensZblocksZa1Za2�b1�b2Zbtyper�rFrfrE�tokensZ
nextisnewlineZisendoflineZchompZ	endoflineZ	endspacesZmaybetabZcurrentlabelr(r(r)�diffsinglehunkinline�
sn

�




rRc/s�|�d�r|djrt�nt�gd�}dg}d}g���fdd�}||i|��D�]4}|�d�}t|�}	t|�D�]�\}
}|r�|�d�r�d}n|r�|�d	�s�d
}d}|s�|r�|�d�r�d
}|}
|r�|}
|r�|}|
d|	kr�|d7}��|�qp|�D]
}|Vq�|�	�}|
D]F\}}|�|��r||fV||k�rJ|t|�d
�dfV�q^�q|dfV|
d|	krpdVqp|�D]}|V�qxqPd
S)z@yields 2-tuples of (output, label) based on the output of func()r)
)r�s
diff.diffline)�copy�
diff.extended)�renamerT)soldrT)snewrT)sdeletedrT)sindexrT)s
similarityrT)rsdiff.file_a)r�sdiff.file_b)r�s	diff.hunkFc3s(�r$���D]
}|Vqg�dd�<dSrNr()rF�Z
dodiffhunkZ
hunkbufferr(r)�consumehunkbuffersz$difflabel.<locals>.consumehunkbufferrtr�)rrrr�r{T)rrrNr?r,�rtr,)
r3ZworddiffrRrGr#r$rIr"r3r�)�funcr�kwZheadprefixesZtextprefixes�headrWr0r/Z	linecountr�r%�diffline�prefixesZbufferedlinerFrDrfrEr(rVr)�	difflabel�
s^
�

�


�


r^cOsttg|�Ri|��S)zBlike diff(), but yields 2-tuples of (output, label) for ui.write())r^r!)rrZr(r(r)�diffuiMsr_c
cs�t�}dd�|��D�}t|�t|�}}t|||�D]�}	d}
|	|	}}|	|vr�d}|	|vr�|jr�||	}||vr�||vr�d}
|�|�q�d}
n8|	|vr�d}|jr�|	|vr�||	|vr�|||	|	kr�q:|||
fVq:dS)agenerates tuples (f1, f2, copyop), where f1 is the name of the file
    before and f2 is the the name after. For added files, f1 will be None,
    and for removed files, f2 will be None. copyop may be set to None, 'copy'
    or 'rename' (the latter two only if opts.git is set).cSsi|]\}}||�qSr(r()rw�krwr(r(r)r.Yr,z_filepairs.<locals>.<dictcomp>NrUrS)r�r�r�r5r�)
r1rWr�r�rZgoneZcopytor9r:r�copyop�f1�f2r(r(r)�
_filepairsRs4
�
��rdcCs4|sd}t|�}t�d|�}|�|�t|���S)Nr,sblob %d)r$rZsha1rr�digest)r�r'r-r(r(r)�	_gitindexws
rfs120000s100755s100644)rrr,c$cs2|	jrd}}
nd}d}
dd�}dd�}t�|���}t�|���}|sPdd	�}t|||||	�D�]�\}}}d
}d
}d
}d
}d
}d
}|r�|||�}|	js�|
r�|�|�}|r�|||�}|	js�|
r�|�|�}|	jr�d}ntdd
�||fD��}|
�rX|	j�sX|�sJ||v�sJ|�s||��sJ||��r(|�rJ|�s4|�sJ|�rX|�rX||k�rX|
|�pT|�||�pb|�}||�pp|�}g}|	j�r`|�	d|||
|f�|�s�|�	dt
|�n�|�s�|�	dt
|�n�t
|t
|}} || k�r|�	d|�|�	d| �|d
u�rv|	j�r:t�
||||�d}!|�	d|!�|�	d||f�|�	d||f�n|�rv|�	|||��|�r�|	j�r�|	j�r�|	j�r�|	j�s�|d
u�r�d}|d
u�r�|d
u�r�|�|��s�d}nd}n$|d
u�r�|��}|d
u�r�|��}||||||f}"||||||f}#t|"|#|||	�Vq`d
S)z�given input data, generate a diff and yield it in blocks

    If generating a diff would lose data like flags or binary data and
    losedatafn is not None, it will be called.

    pathfn is applied to every path in the diff output.
    r,r�r�cSs d�dd�|D��}d||fS)NrcSsg|]}d|�qS)s-r %sr()rwr8r(r(r)rX�r,z-trydiff.<locals>.diffline.<locals>.<listcomp>s
diff %s %sr)rr2Zrevinfor(r(r)r\�sztrydiff.<locals>.difflinecSs|dup|��dkSr�)r)rr(r(r)�isempty�sztrydiff.<locals>.isemptycSs|SrNr()rr(r(r)r2�r,ztrydiff.<locals>.<lambda>NFcss|]}|dur|��VqdSrN)�isbinaryr�r(r(r)ry�r,ztrydiff.<locals>.<genexpr>sdiff --git %s%s %s%ssnew file mode %ssdeleted file mode %ssold mode %ssnew mode %s�dssimilarity index %d%%s
%s from %ss%s to %s�s)ZnoprefixrZdatestr�daterdr5rr�rUr3�_gitmodeZshowsimilarityrZscore�nobinary�index�cmpr��diffcontent)$r�r2rrr1rWr�r�r(rrrZaprefixZbprefixr\rg�date1�date2rbrcra�content1�content2rr �flag1�flag2r��path1�path2r�Zmode1Zmode2Zsim�data1�data2r(r(r)r/�s�






����
�
�
�
�����


����



r/c
Cs|\}}}}}	}
|\}}}
}}}||vr0t|	�ntj}|
|vrFt|�ntj}|r�|jr�|js�t�|	|�}|r~|�d||f�d|gff}nt|jr�|jdkr�|}|dur�|}|�d|d|j�|d|j�t	|f�tj
|	|
||||
||d�\}}|�|�||||fS)aOdiffs two versions of a file.

    data1 and data2 are tuples containg:

        * ctx: changeset for the file
        * fctx: file context for that file
        * path1: name of the file
        * flag: flags of the file
        * content: full content of the file (can be null in case of binary)
        * date: date of the changeset

    header: the patch header
    binary: whether the any of the version of file is binary or not
    opts:   user passed options

    It exists as a separate function so that extensions like extdiff can wrap
    it and use the file content directly.
    sindex %s..%sNrsindex %s..%s %s)r�r)rfrZnullhexr5rmrZb85diffr3rnrlZunidiff�extend)ryrzr�r�rrrrwrursrqrr rxrvrtrrZindex1�index2r�r(�flagZuheadersr(r(r)rpsB���	�


rpc
Csdd\}}}}}|D]B\}}}}	t|t�|��}t|||�}||7}||7}|pR|	}q|||||fS)N)rrrrF)rVr�colwidth)
�statsZmaxfile�maxtotalZaddtotalZremovetotalr�rr@r�rBr(r(r)�diffstatsumLs
r�cs.t�d�}g�d\���������fdd�}d}|D]�}|�d�r�|�d}d\���|�d	�rtt�|��d
��n|�d�r�|�|��d��q6|�d
�r�d}q6|�d�r�|s��d7�q6|�d�r�|sЈd7�q6|�d�s�|�d�r�d�q6|�d��r|dd��q6|�d�r6�d|dd�7�q6|��S)Ns^diff .*-r [a-z0-9]+\s(.*)$)NrrFcs�r������f�dSrNrKr(��addsrcrh�removes�resultsr(r)�	addresult^szdiffstatdata.<locals>.addresultFr�T)rrFr�r!sdiff -rrs@@rrr�sBinary filesrename fromr�s	rename tos => %sr�)r�r�r"r�r�r�)r/r�r�r&r%r(r�r)�diffstatdataXs<







�
r��Pc
s�g}t|�}t|�\}�}}}tt���}|r:|dkr:d}|||d��dkrVd���fdd�}	|D]b\}
}}}
|
r~d}nd||}d|	|�}d	|	|�}|�d
|
d|t�|
�||||f�qh|r�|�td�t|�||f�d
�|�S)Nr�r�r�cs&��kr|St|��tt|���SrN)rVr��bool)r��Z
graphwidthr�r(r)�scale�szdiffstat.<locals>.scalesBinrrrs %s%s |  %*s %s%s
rs5 %d files changed, %d insertions(+), %d deletions(-)
r,)	r�r�r$r�r3rr~rr.)r/�width�outputrZmaxnameZ	totaladdsZtotalremovesZ	hasbinaryZ
countwidthr�rcr�r�rhr�ZplusesZminusesr(r�r)�diffstat�sD�����r�cos�t|i|����D]�}|r�|ddvr�|�dd�\}}|ddfVt�d|�}|rd|�d�dfVt�d	|�}|r�|�d�d
fVn
|dfVdVqdS)
zOlike diffstat(), but yields 2-tuples of (output, label) for
    ui.write()
    r*s+-rrr,s\++rsdiffstat.inserteds-+sdiffstat.deletedrXN)r�r��rsplitr�r�r�)rrZr%�nameZgraphr>r(r(r)�
diffstatui�s
r�)N)N)rr,r)rr,r)Nr)r,Nrr)Nr)rr,Nrr)rr,)
NNNNNNNNNN)NNNNNNN)r�)lZ
__future__rrr)�
contextlibr�r�rir�r	r�Zi18nrr,rrr	rr
�rrr
rrrrrrrrrr�Zutilsrrrrr-r�r�rArMr�r=r�r#r��contextmanagerrsrkr`r�r�r�r�r�r�rrr�r�rrr�rjr�r�r8rEr�r�r�r�r�r�r�r�r�r�r�r�r
rrrrr�	ExceptionrZdiffalloptsZdiffoptsZdifffeatureoptsr!rrGrRr^r_rdrfrlr/rpr�r�r�r�r(r(r(r)�<module>	s�<

�
q0-#41&.

jPnC
7e>@
)=3g;
	�
_2�
#�
�
�
!
�
O�
HP%	9-
0

Youez - 2016 - github.com/yon3zu
LinuXploit