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/hgext/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/hgext/__pycache__/extdiff.cpython-39.opt-1.pyc
a

�+�b�c�@s0dZddlmZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZddl
mZmZmZmZmZmZmZmZmZmZmZddlmZmZiZe�e�ZiZe�e�Zedd	d
dd�edd
dd�eddddd�edddd�dZ dd�Z!dd�Z"dGdd�Z#dd�Z$dd�Z%dd�Z&dHd d!�Z'd"d#ge	d$�e	d%�fd&d'ge	d(�e	d)�fd
d*d
e	d+�e	d,�fd
d-d
e	d.�e	d/�fd0d1d
e	d2�e	d)�fd
d3de	d4�fd
d5de	d6�fd
d7de	d8�fgej(ej)Z*edd9d:d
e	d;�e	d<�fge*e	d=�ej+dd>�d?d@��Z,GdAdB�dBe-�Z.dCdD�Z/dEdF�Z0e.gZ1dS)IaBcommand to allow external programs to compare revisions

The extdiff Mercurial extension allows you to use external programs
to compare revisions, or revision with working directory. The external
diff programs are called with a configurable set of options and two
non-option arguments: paths to directories containing snapshots of
files to compare.

If there is more than one file being compared and the "child" revision
is the working directory, any modifications made in the external diff
program will be copied back to the working directory from the temporary
directory.

The extdiff extension also allows you to configure new diff commands, so
you do not need to type :hg:`extdiff -p kdiff3` always. ::

  [extdiff]
  # add new command that runs GNU diff(1) in 'context diff' mode
  cdiff = gdiff -Nprc5
  ## or the old way:
  #cmd.cdiff = gdiff
  #opts.cdiff = -Nprc5

  # add new command called meld, runs meld (no need to name twice).  If
  # the meld executable is not available, the meld tool in [merge-tools]
  # will be used, if available
  meld =

  # add new command called vimdiff, runs gvimdiff with DirDiff plugin
  # (see http://www.vim.org/scripts/script.php?script_id=102) Non
  # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
  # your .vimrc
  vimdiff = gvim -f "+next" \
            "+execute 'DirDiff' fnameescape(argv(0)) fnameescape(argv(1))"

Tool arguments can include variables that are expanded at runtime::

  $parent1, $plabel1 - filename, descriptive label of first parent
  $child,   $clabel  - filename, descriptive label of child revision
  $parent2, $plabel2 - filename, descriptive label of second parent
  $root              - repository root
  $parent is an alias for $parent1.

The extdiff extension will look in your [diff-tools] and [merge-tools]
sections for diff tool arguments, when none are specified in [extdiff].

::

  [extdiff]
  kdiff3 =

  [diff-tools]
  kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child

If a program has a graphical interface, it might be interesting to tell
Mercurial about it. It will prevent the program from being mistakenly
used in a terminal-only environment (such as an SSH terminal session),
and will make :hg:`extdiff --per-file` open multiple file diffs at once
instead of one by one (if you still want to open file diffs one by one,
you can use the --confirm option).

Declaring that a tool has a graphical interface can be done with the
``gui`` flag next to where ``diffargs`` are specified:

::

  [diff-tools]
  kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
  kdiff3.gui = true

You can use -I/-X and list of file or directory names like normal
:hg:`diff` command. The extdiff extension makes snapshots of only
needed files, so running the external diff program will actually be
pretty fast (at least faster than having to compare the entire tree).
�)�absolute_importN)�_)�nullrev�short)�archival�cmdutil�encoding�error�	filemerge�	formatter�
logcmdutil�pycompat�	registrar�scmutil�util)�procutil�
stringutil�extdiffsopts\..*�T)�default�genericsgui\..*)r�
diff-toolss
.*\.diffargs$s.*\.gui$sships-with-hg-corec	Cs tj�|j�}|dkrd}|dur2d|t|�f}tj�||�}t�|�g}|durv|�td�t	|�t|�f�n|�td�t	|��|�r|j
�ddd	�tj
|||d
t�||�|d�t|�D]N}	t�|	�}
|�d|
�|dur�tj�||
�}|�||�|	�t�|�f�q�||fS)
z�snapshot files as of some revision
    if not using snapshot, -I/-X does not work and recursive diff
    in tools like kdiff3 and meld displays too many files.r�rootNs%s.%ss(making snapshot of %d files from rev %s
s3making snapshot of %d files from working directory
suisarchivemetaFsfiles)�match�subreposs  %s
)�os�path�basename�rootr�join�mkdir�noter�len�uiZ	setconfigr�archiverZ
matchfiles�sortedrZpconvert�appendZwjoin�lstat)r#�repo�files�node�tmproot�listsubrepos�dirname�base�
fnsandstat�fnZwfn�dest�r2�3/usr/lib64/python3.9/site-packages/hgext/extdiff.py�snapshot�sH
����
�	
r4c		sN||||||||d����fdd�}	d}
�s@t�|
|�s@|d7}t�|
|	|�S)N)sparentsparent1�parent2splabel1splabel2schildsclabelrcs6|�d�}|�d�}�s$|dkr$|S|t��|�S)N��r5)�groupr�
shellquote)rZpre�key��do3way�replacer2r3�quote�s


zformatcmdline.<locals>.quotesJ(['"]?)([^\s'"$]*)\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1s $parent1 $child)�re�search�sub)�cmdline�	repo_rootr<�parent1�plabel1�parent2�plabel2�child�clabelr>Zregexr2r;r3�
formatcmdline�s�	�rJc	Cs:t�|�}tjt�|�dtjt�|�t�tj|�d�}|S)zflike 'procutil.system', but returns the Popen object directly
    so we don't have to wait on it.
    T)�shellZ	close_fds�env�cwd)	rZshellenviron�
subprocess�PopenZtonativestrZclosefdsZtonativeenvr
Zrapply)�cmd�environrMrL�procr2r2r3�_systembackground�s
�rScCsg}t|�}tt|��D�]�\}}tj�||�}||}tj�|�sJtj}d}d}|r~tj�|	|�}||}tj�|�s~tj}tj�|
|�}||
}|�rLt	d�||d|f}t	d�}|�
d||f�}|dk�r"|dk�r"|�|�dD] \}}|�d|t
�|�f�q�|�
d||f�}q�|dk�r.n|dk�r<qn|d	k�rL�q�t|||||||||d
�	}|�sr|�s�|�dt�|�|f�|j||dd
�q|�dt�|�|f�t||d�}|�|�q|�r|�d��$|D]}|���q�Wd�n1�s0YdS)Nrsdiff %s (%d of %d)�sZ[Yns?]$$ &Yes, show diff$$ &No, skip this diff$$ &Skip remaining diffs$$ &? (display help)s%s %sr7s%s - %s
rr6�r<rDrErFrGrHrI�running %r in %s
r�rMZ
blockedtags running %r in %s (backgrounded)
)rM)r"�	enumerater%rrr�isfiler
�	osdevnullrZpromptchoiceZextractchoices�writer�lowerrJ�debug�bytestr�systemrSr&Ztimeblockedsection�wait)rBrCr#�guitoolr<�confirm�commonfilesr+�dir1a�dir1b�dir2�rev1a�rev1b�rev2Z	waitprocsZ
totalfiles�idxZ
commonfileZpath1a�label1aZpath1b�label1bZpath2�label2Z	difffilesZ	responses�r�c�tZ
curcmdlinerRr2r2r3�_runperfilediffs���




����rqc
Cs�d}t�|di��B}tj|||��||��g||j�||�|d�Wd�n1sZ0Yt�|||�}	t�|||�}
|j�||	�}|j�||
�}t||j	d||	dd||
d�	}|�
dt�|�|f�|j
||dd�dS)	Nshg-%h.patchr)Z
fntemplaterFrUrVrWrT)rZ
nullformatterrZexport�revZvfsZreljoinZmakefilenamerJrr]r
r^r_)
r#r(Znode1Znode2r+�matcherrB�templateZfmZlabel1rmZfile1Zfile2r2r2r3�	diffpatchks6�$�
ruc'Csp|
�d�}|j|||d�}t|j�t|j�t|j�}
}}|rt|j|||d�}t|j�t|j�t|j�}}}nt�t�t�}}}|
|B|B|B}||B|B}|s�dS|
|B||B|B}t||||��||�d}|��dur�dn
d|��}|�r:||B|
|B|B}t||||��||�d}d|��}nd}d}g}d}d}|��du�r�t||||��||�d}d|��}n0t	|�dk�r�t|||d||�\}}n
d}|j
}|} |}!|}"|
�d��s�t	|�dk�r^t�|�
��}#tj�|||#�}|#|} tj�|��stj}|�rFtj�|||#�}|#|}!tj�|��sFtj}tj�|||#�}|#|}"t||j
||| ||!||"d�	}|�d	t�|�|f�|j||d
d�nTt||j
||	||
�d�||tj�||�|�r�tj�||�ndtj�||�|||d
�|D]n\}$}%}t�|$�}&|&tj|tjk�sJ|&j|jk�sJ|&jd@|jd@k�r�|�d|%|$f�t�|$|%��q�dS)N�subrepos)r,rrs@%drT�per_filerUrVrrW�confirm)rar<rbrcr+rdrerfrgrhri�@s6file changed while diffing. Overwriting: %s (src: %s)
)�get�status�setZmodifiedZaddedZremovedr4r*rrr"rrZ	localpath�poprrrrYr
rZrJr]r^r_rqr'�stat�ST_MTIME�st_size�st_mode�copyfile)'r#r(�ctx1a�ctx1b�ctx2rsr+rBr<ra�optsr�stZmod_aZadd_aZrem_aZstbZmod_bZadd_bZrem_bZmodadd�commonZdir1a_filesrdrgZdir1b_filesrerhr/Zdir2rootrirfrkrlrmZcommon_fileZcopy_fnZ
working_fnZcpstatr2r2r3�diffrevs�s�
"�����
	�
����r�FcCs�t�|dd�|�d�}|�d�}|�d�}|�d�}	d|v}
|	rdt�||	d�}|��|��}}
nn|sl|r�t�||g|gd�}t�||d�}|t	}
t�||d�}n*t�
||�\}}|s�|d��}
n|t	}
|
r�|
��t	kr�d}
t�|||�}|�d	��rP|�d
��rt
�td���|�d��r4t
�td
���|��du�rPt
�td���tjdd�}zx|�d	��r�t|||��|��|||�W|�td��t�|�St||||
|||||
||�W|�td��t�|�S|�td��t�|�0dS)a
Do the actual diff:

    - copy to a temp structure if diffing 2 internal revisions
    - copy to a temp structure if diffing working revision with
      another one and more than 1 file is changed
    - just invoke the diff for a single file in the working dir
    �rev�change�from�tos$parent2NsnowarnF�patchrvs&--patch cannot be used with --subreposrws&--patch cannot be used with --per-files--patch requires two revisionssextdiff.)�prefixscleaning up temp directory
)rZcheck_at_most_one_argrzrZ	revsingleZp1Zp2rZunhidehashlikerevsrZrevpairrrrr	ZAbortrr*r
Zmkdtemprur!�shutil�rmtreer�)r#r(rB�patsr�raZrevsZfrom_revZto_revZchanger<r�r�r�rsr+r2r2r3�dodiff!sx	



��
��
��r��o�options!pass option to comparison programsOPT�rr�srevision (DEPRECATED)sREVr�srevision to diff fromsREV1r�srevision to diff tosREV2�cr�schange made by revisionsper-files/compare each file instead of revision snapshotsrxs3prompt user before each external program invocationr�s!compare patches for two revisions�p�programscomparison program to runsCMDshg extdiff [OPT]... [FILE]...�ZhelpcategoryZ	inferrepocOsXt�|�}|�d�}|�d�}|s0d}|p.dg}d�ttj|g|��}t|||||�S)aPuse external program to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    an external program. The default program used is diff, with
    default options "-Npru".

    To select a different program, use the -p/--program option. The
    program will be passed the names of two directories to compare,
    unless the --per-file option is specified (see below). To pass
    additional options to the program, use -o/--option. These will be
    passed before the names of the directories or files to compare.

    The --from, --to, and --change options work the same way they do for
    :hg:`diff`.

    The --per-file option runs the external program repeatedly on each
    file to diff, instead of once on two directories. By default,
    this happens one by one, where the next file diff is open in the
    external program only once the previous external program (for the
    previous file diff) has exited. If the external program has a
    graphical interface, it can open all the file diffs at once instead
    of one by one. See :hg:`help -e extdiff` for information about how
    to tell Mercurial that a given program has a graphical interface.

    The --confirm option will prompt the user before each invocation of
    the external program. It is ignored if --per-file isn't specified.
    r�r�sdiffs-Npru� )r
�byteskwargsrzr�maprr9r�)r#r(r�r�Zprogram�optionrBr2r2r3�extdiff�s&



r�c@s eZdZdZdd�Zdd�ZdS)�savedcmda�use external program to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    the following program::

        %(path)s

    When two revision arguments are given, then changes are shown
    between those revisions. If only one revision is specified then
    that revision is compared to the working directory, and, when no
    revisions are specified, the working directory files are compared
    to its parent.
    cCs@t�|��dd�}|jdt�t�|��i;_||_||_dS)Ns\\�\r)	rZ	escapestrr=�__doc__r
ZsysstrZuirepr�_cmdline�_isgui)�selfrrB�isguiZdocpathr2r2r3�__init__�szsavedcmd.__init__cOsHt�|�}d�ttj|d��}|r,d|}t|||j||||jd�S)Nr�r�)ra)	r
r�rr�rr9r�r�r�)r�r#r(r�r��optionsr2r2r3�__call__�s
�zsavedcmd.__call__N)�__name__�
__module__�__qualname__r�r�r�r2r2r2r3r��s	r�c	CsDt�|�}|�d�r�|dd�}|sFt�|�}|durFt�||�pD|}|�dd|�}t�|�}|rp|d|7}|�	dd|�}n\|r�|}t
t�|��dk}n0t�|�}|dur�t�||�p�|}t�|�}d	}|�	dd|�}|�s8|d
}dD]F}|�||�}|r�|d|7}|du�r0|�	||d��p.d	}�q8q�||||fS)
a�
    returns following things for a
    ```
    [extdiff]
    <cmd> = <path>
    ```
    entry:

    cmd: command/tool name
    path: path to the tool
    cmdline: the command which should be run
    isgui: whether the tool uses GUI or not

    Reads all external tools related configs, whether it be extdiff section,
    diff-tools or merge-tools section, or its specified in an old format or
    the latest format.
    scmd.�Nr�opts.r��gui.rTFs	.diffargs)rsmerge-toolss.gui)
rZ
expandpath�
startswithrZfindexer
ZfindexternaltoolZconfigr9Z
configboolr"r
Z
shlexsplit)	r#rPrZdiffoptsrBr�r:�section�argsr2r2r3�_gettooldetails�s>






r�cCsr|�d�D]b\}}|�d�s
|�d�r(q
t|||�\}}}}t|tdd�td�|tjdd�t|||��q
dS)Nrr�r�shg %s [OPTION]... [FILE]...Tr�)Zconfigitemsr�r��command�extdiffoptsr�CATEGORY_FILE_CONTENTSr�)r#rPrrBr�r2r2r3�uisetups

�
�r�)NN)F)2r�Z
__future__rrr?r�r~rNZmercurial.i18nrZmercurial.noderrZ	mercurialrrrr	r
rrr
rrrZmercurial.utilsrrZcmdtabler�ZconfigtableZ
configitemZ
testedwithr4rJrSrqrur�r�ZwalkoptsZsubrepooptsr�r�r��objectr�r�r�Z
i18nfunctionsr2r2r2r3�<module>s�L4


����
/*
i!
M������� ���

&"8

Youez - 2016 - github.com/yon3zu
LinuXploit