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/usr/lib64/python2.7/site-packages/hgext/extdiff.pyo
�
1�3\c@@s7dZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZddlm
Z
mZmZmZmZmZmZmZmZddlmZmZiZeje�ZiZeje�Zedd	d
dde�ed
dd
dde�dZd�Z d�Z!ddged�ed�fddged�ed�fddded�ed�fddded�fgej"ej#Z$eddd ded!�ed"�fge$ed#�d$ej%d%e�d&��Z&d'e'fd(��YZ(d)�Z)e(gZ*dS(*s�command 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

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).
i(tabsolute_importN(t_(tnullidtshort(	tarchivaltcmdutilterrort	filemerget	formattertpycompatt	registrartscmutiltutil(tprocutilt
stringutiltextdiffsopts\..*tdefaultttgenerics
diff-toolss
.*\.diffargs$sships-with-hg-corec	C@s�tjj|j�}|dkr*d}n|dk	rOd|t|�f}ntjj||�}tj|�g}|dk	r�|jt	d�t
|�t|�f�n|jt	d�t
|��|r�|jjddt
�tj|||dd	tj||�d
|�x�t|�D]r}	tj|	�}
|jd|
�|dkr#tjj||
�}|j||j|	�tj|�f�q#q#Wn||fS(
s�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.Rtroots%s.%ss(making snapshot of %d files from rev %s
s3making snapshot of %d files from working directory
tuitarchivemetatfilestmatchfntsubreposs  %s
N(tostpathtbasenameRtNoneRtjointmkdirtnoteRtlenRt	setconfigtFalseRtarchiveRt
matchfilestsortedRtpconverttappendtwjointlstat(RtrepoRtnodettmproottlistsubrepostdirnametbaset
fnsandstattfntwfntdest((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pytsnapshotvs2	
2c/@s�|jd�}|jd�}d|k�|rT|rTtd�}tj|��nr|r�tj||d�}|j�|j�}	}
n;tj	||�\}	}|s�|dj�}
n
|t
}
|	j�}|
j�}|j�}
�r|t
krt�qn|jd�}tj
||
||�}|jd�r�|r]tjtd���n|
dkr6tjtd���q6n�tt|j||
|d	|�d
 �\}}}�r�tt|j||
|d	|�d
 �\}}}nt�t�t�}}}||B|B|B}||B|B}|s6dStjdd
�}zv|jd�s~||B||B|B}t||||||�d}d||j�}�r�||B||B|B}t||||||�d}d||j�}nd}d}g}d} d}!|
rOt||||
||�d}"d||
j�}!nEt|�dkr�t|||d||�\}"}nd}"|j} |}#|}$|!}%t|�dkrRtj|j��}&tjj|||&�}|&|}#tjj|�s
tj}n�rVtjj|||&�}|&|}$tjj|�sVtj}qVntjj| |"|&�}"|&|!}%qRn�d}'tj |di��O}(t!j"|||j�||
j�g|(d|j#j$||'�d|�WdQXt!j%|||'�}#t!j%||
|'�}%|j#j$||#�}|j#j$||%�}"d}d}$g}i|d6|d6|d6|#d6|$d6|%d6|"d6|jd6���fd�})d}*�r�t&j'|*|�r�|d 7}nt&j(|*|)|�}|j)d!tj*|�|f�|j+|d"|d#d�x�|D]�\}+},}-tj,|+�}.|.t-j.|-t-j.ks�|.j/|-j/ks�|.j0d$@|-j0d$@kr'|j)d%|,|+f�tj1|+|,�q'q'WdSWd|j2td&��t3j4|�XdS('s
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
    trevtchanges$parent2s2cannot specify --rev and --change at the same timeRtpatchs&--patch cannot be used with --subreposs--patch requires two revisionsR-iitprefixsextdiff.s@%dRishg-%h.patchRt
fntemplatetmatchNtparenttparent1tparent2tplabel1tplabel2tclabeltchildRc@sJ|jd�}|jd�}�r5|dkr5|S|tj�|�S(NiiR=(tgroupR
t
shellquote(R:tpretkey(tdo3waytreplace(s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pytquote#s
sJ(['"]?)([^\s'"$]*)\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1s $parent1 $childsrunning %r in %s
tcwdt
blockedtagi@s6file changed while diffing. Overwriting: %s (src: %s)
scleaning up temp directory
(5tgetRRtAbortRt	revsingleRtp1tp2trevpairRR+R"R:tmaptsettstatusR	tmkdtempR4R5R RRt	localpathtpopRRRtisfiletdevnullRt
nullformatterRtexporttvfstreljointmakefilenametretsearchtsubtdebugtbytestrtsystemR)tstattST_MTIMEtst_sizetst_modetcopyfileRtshutiltrmtree(/RR*tcmdlinetpatstoptstrevsR6tmsgtctx2tctx1atctx1btnode1atnode1btnode2Rtmatchertmod_atadd_atrem_atmod_btadd_btrem_btmodaddtcommonR,tdir1a_filestdir1atrev1atdir1b_filestdir1btrev1bR0tdir2roottrev2tdir2tlabel1atlabel1btlabel2tcommon_filettemplatetfmRHtregextcopy_fnt
working_fntsttcpstat((RFRGs3/usr/lib64/python2.7/site-packages/hgext/extdiff.pytdodiff�s�	


	

&


 	totoptions!pass option to comparison programtOPTtrR5trevisiontREVtcR6schange made by revisionR7s!compare patches for two revisionstptprogramscomparison program to runtCMDshg extdiff [OPT]... [FILE]...thelpcategoryt	inferrepocO@s�tj|�}|jd�}|jd�}|sKd}|pEdg}ndjttj|g|��}t|||||�S(suse 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. To
    pass additional options to the program, use -o/--option. These
    will be passed before the names of the directories to compare.

    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.R�R�tdiffs-Nprut (R	tbyteskwargsRKRRQR
RCR�(RR*RlRmR�R�Rk((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pyRQs"tsavedcmdcB@s eZdZd�Zd�ZRS(s�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.
    cC@sDtj|�}|jitjtj|��d6;_||_dS(NR(Rt	escapestrt__doc__R	tsysstrtuireprt_cmdline(tselfRRktdocpath((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pyt__init__�s(cO@s^tj|�}djttj|d��}|rAd|}nt|||j|||�S(NR�R�(R	R�RRQR
RCR�R�(R�RR*RlRmtoptions((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pyt__call__�s

(t__name__t
__module__R�R�R�(((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pyR�qs
	c	C@s�x�|jd�D]�\}}tj|�}|jd�r�|d}|s�tj|�}|dkr�tj||�pz|}q�n|j	dd|�}tj
|�}|rL|d|7}qLn�|jd�r�qnu|r|}ttj
|��dk}nKtj|�}|dkr7tj||�p1|}ntj
|�}t}|s�|j	d|d�p{|j	d	|d�}|r�|d|7}q�nt|ttd
�|dtjdt�t||��qWdS(
NRscmd.isopts.R�is
diff-toolss	.diffargssmerge-toolsshg %s [OPTION]... [FILE]...R�R�(tconfigitemsRt
expandpatht
startswithR
tfindexeRRtfindexternaltooltconfigRCR R	t
shlexsplitR"tcommandtextdiffoptsRtCATEGORY_FILE_CONTENTStTrueR�(RtcmdRtdiffoptsRktargs((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pytuisetup�s<
	(+R�t
__future__RRR^RiRdtmercurial.i18nRtmercurial.nodeRRt	mercurialRRRRRR	R
RRtmercurial.utilsR
RtcmdtableR�tconfigtablet
configitemR�Rt
testedwithR4R�twalkoptstsubrepooptsR�R�RtobjectR�R�t
i18nfunctions(((s3/usr/lib64/python2.7/site-packages/hgext/extdiff.pyt<module>Bs@@	%	��!		&