Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/extdiff.py (105 lines) | |||
M | tests/test-extdiff.t (40 lines) | |||
M | tests/test-extension.t (22 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Ludovic Chabant | Feb 3 2019, 12:58 AM |
:: | :: | ||||
[extdiff] | [extdiff] | ||||
kdiff3 = | kdiff3 = | ||||
[diff-tools] | [diff-tools] | ||||
kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child | 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 | You can use -I/-X and list of file or directory names like normal | ||||
:hg:`diff` command. The extdiff extension makes snapshots of only | :hg:`diff` command. The extdiff extension makes snapshots of only | ||||
needed files, so running the external diff program will actually be | needed files, so running the external diff program will actually be | ||||
pretty fast (at least faster than having to compare the entire tree). | pretty fast (at least faster than having to compare the entire tree). | ||||
''' | ''' | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
import os | import os | ||||
import re | import re | ||||
import shutil | import shutil | ||||
import stat | import stat | ||||
import subprocess | |||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial.node import ( | from mercurial.node import ( | ||||
nullid, | nullid, | ||||
short, | short, | ||||
) | ) | ||||
from mercurial import ( | from mercurial import ( | ||||
archival, | archival, | ||||
configtable = {} | configtable = {} | ||||
configitem = registrar.configitem(configtable) | configitem = registrar.configitem(configtable) | ||||
configitem('extdiff', br'opts\..*', | configitem('extdiff', br'opts\..*', | ||||
default='', | default='', | ||||
generic=True, | generic=True, | ||||
) | ) | ||||
configitem('extdiff', br'gui\..*', | |||||
generic=True, | |||||
) | |||||
configitem('diff-tools', br'.*\.diffargs$', | configitem('diff-tools', br'.*\.diffargs$', | ||||
default=None, | default=None, | ||||
generic=True, | generic=True, | ||||
) | ) | ||||
configitem('diff-tools', br'.*\.gui$', | |||||
generic=True, | |||||
) | |||||
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | ||||
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | ||||
# be specifying the version(s) of Mercurial they are tested with, or | # be specifying the version(s) of Mercurial they are tested with, or | ||||
# leave the attribute unspecified. | # leave the attribute unspecified. | ||||
testedwith = 'ships-with-hg-core' | testedwith = 'ships-with-hg-core' | ||||
def snapshot(ui, repo, files, node, tmproot, listsubrepos): | def snapshot(ui, repo, files, node, tmproot, listsubrepos): | ||||
'''snapshot files as of some revision | '''snapshot files as of some revision | ||||
# Match parent2 first, so 'parent1?' will match both parent1 and parent | # Match parent2 first, so 'parent1?' will match both parent1 and parent | ||||
regex = (br'''(['"]?)([^\s'"$]*)''' | regex = (br'''(['"]?)([^\s'"$]*)''' | ||||
br'\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1') | br'\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1') | ||||
if not do3way and not re.search(regex, cmdline): | if not do3way and not re.search(regex, cmdline): | ||||
cmdline += ' $parent1 $child' | cmdline += ' $parent1 $child' | ||||
return re.sub(regex, quote, cmdline) | return re.sub(regex, quote, cmdline) | ||||
def _runperfilediff(cmdline, repo_root, ui, do3way, confirm, | def _systembackground(cmd, environ=None, cwd=None): | ||||
''' like 'procutil.system', but returns the Popen object directly | |||||
so we don't have to wait on it. | |||||
''' | |||||
cmd = procutil.quotecommand(cmd) | |||||
env = procutil.shellenviron(environ) | |||||
proc = subprocess.Popen(procutil.tonativestr(cmd), | |||||
shell=True, close_fds=procutil.closefds, | |||||
env=procutil.tonativeenv(env), | |||||
cwd=pycompat.rapply(procutil.tonativestr, cwd)) | |||||
return proc | |||||
def _runperfilediff(cmdline, repo_root, ui, guitool, do3way, confirm, | |||||
commonfiles, tmproot, dir1a, dir1b, | commonfiles, tmproot, dir1a, dir1b, | ||||
dir2root, dir2, | dir2root, dir2, | ||||
rev1a, rev1b, rev2): | rev1a, rev1b, rev2): | ||||
# Note that we need to sort the list of files because it was | # Note that we need to sort the list of files because it was | ||||
# built in an "unstable" way and it's annoying to get files in a | # built in an "unstable" way and it's annoying to get files in a | ||||
# random order, especially when "confirm" mode is enabled. | # random order, especially when "confirm" mode is enabled. | ||||
waitprocs = [] | |||||
totalfiles = len(commonfiles) | totalfiles = len(commonfiles) | ||||
for idx, commonfile in enumerate(sorted(commonfiles)): | for idx, commonfile in enumerate(sorted(commonfiles)): | ||||
path1a = os.path.join(tmproot, dir1a, commonfile) | path1a = os.path.join(tmproot, dir1a, commonfile) | ||||
label1a = commonfile + rev1a | label1a = commonfile + rev1a | ||||
if not os.path.isfile(path1a): | if not os.path.isfile(path1a): | ||||
path1a = os.devnull | path1a = os.devnull | ||||
path1b = '' | path1b = '' | ||||
elif r == 2: # skip | elif r == 2: # skip | ||||
break | break | ||||
curcmdline = formatcmdline( | curcmdline = formatcmdline( | ||||
cmdline, repo_root, do3way=do3way, | cmdline, repo_root, do3way=do3way, | ||||
parent1=path1a, plabel1=label1a, | parent1=path1a, plabel1=label1a, | ||||
parent2=path1b, plabel2=label1b, | parent2=path1b, plabel2=label1b, | ||||
child=path2, clabel=label2) | child=path2, clabel=label2) | ||||
ui.debug('running %r in %s\n' % (pycompat.bytestr(curcmdline), | |||||
tmproot)) | |||||
if confirm or not guitool: | |||||
# Run the comparison program and wait for it to exit | # Run the comparison program and wait for it to exit | ||||
# before we show the next file. | # before we show the next file. | ||||
# This is because either we need to wait for confirmation | |||||
# from the user between each invocation, or because, as far | |||||
# as we know, the tool doesn't have a GUI, in which case | |||||
# we can't run multiple CLI programs at the same time. | |||||
ui.debug('running %r in %s\n' % | |||||
(pycompat.bytestr(curcmdline), tmproot)) | |||||
ui.system(curcmdline, cwd=tmproot, blockedtag='extdiff') | ui.system(curcmdline, cwd=tmproot, blockedtag='extdiff') | ||||
else: | |||||
# Run the comparison program but don't wait, as we're | |||||
# going to rapid-fire each file diff and then wait on | |||||
# the whole group. | |||||
ui.debug('running %r in %s (backgrounded)\n' % | |||||
(pycompat.bytestr(curcmdline), tmproot)) | |||||
proc = _systembackground(curcmdline, cwd=tmproot) | |||||
waitprocs.append(proc) | |||||
if waitprocs: | |||||
with ui.timeblockedsection('extdiff'): | |||||
for proc in waitprocs: | |||||
proc.wait() | |||||
def dodiff(ui, repo, cmdline, pats, opts): | def dodiff(ui, repo, cmdline, pats, opts, guitool=False): | ||||
'''Do the actual diff: | '''Do the actual diff: | ||||
- copy to a temp structure if diffing 2 internal revisions | - copy to a temp structure if diffing 2 internal revisions | ||||
- copy to a temp structure if diffing working revision with | - copy to a temp structure if diffing working revision with | ||||
another one and more than 1 file is changed | another one and more than 1 file is changed | ||||
- just invoke the diff for a single file in the working dir | - just invoke the diff for a single file in the working dir | ||||
''' | ''' | ||||
parent2=dir1b, plabel2=label1b, | parent2=dir1b, plabel2=label1b, | ||||
child=dir2, clabel=label2) | child=dir2, clabel=label2) | ||||
ui.debug('running %r in %s\n' % (pycompat.bytestr(cmdline), | ui.debug('running %r in %s\n' % (pycompat.bytestr(cmdline), | ||||
tmproot)) | tmproot)) | ||||
ui.system(cmdline, cwd=tmproot, blockedtag='extdiff') | ui.system(cmdline, cwd=tmproot, blockedtag='extdiff') | ||||
else: | else: | ||||
# Run the external tool once for each pair of files | # Run the external tool once for each pair of files | ||||
_runperfilediff( | _runperfilediff( | ||||
cmdline, repo.root, ui, do3way=do3way, confirm=confirm, | cmdline, repo.root, ui, guitool=guitool, | ||||
do3way=do3way, confirm=confirm, | |||||
commonfiles=common, tmproot=tmproot, dir1a=dir1a, dir1b=dir1b, | commonfiles=common, tmproot=tmproot, dir1a=dir1a, dir1b=dir1b, | ||||
dir2root=dir2root, dir2=dir2, | dir2root=dir2root, dir2=dir2, | ||||
rev1a=rev1a, rev1b=rev1b, rev2=rev2) | rev1a=rev1a, rev1b=rev1b, rev2=rev2) | ||||
for copy_fn, working_fn, st in fnsandstat: | for copy_fn, working_fn, st in fnsandstat: | ||||
cpstat = os.lstat(copy_fn) | cpstat = os.lstat(copy_fn) | ||||
# Some tools copy the file and attributes, so mtime may not detect | # Some tools copy the file and attributes, so mtime may not detect | ||||
# all changes. A size check will detect more cases, but not all. | # all changes. A size check will detect more cases, but not all. | ||||
When two revision arguments are given, then changes are shown | When two revision arguments are given, then changes are shown | ||||
between those revisions. If only one revision is specified then | between those revisions. If only one revision is specified then | ||||
that revision is compared to the working directory, and, when no | that revision is compared to the working directory, and, when no | ||||
revisions are specified, the working directory files are compared | revisions are specified, the working directory files are compared | ||||
to its parent. | to its parent. | ||||
The --per-file option runs the external program repeatedly on each | The --per-file option runs the external program repeatedly on each | ||||
file to diff, instead of once on two directories. | 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 --confirm option will prompt the user before each invocation of | ||||
the external program. It is ignored if --per-file isn't specified. | the external program. It is ignored if --per-file isn't specified. | ||||
''' | ''' | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
program = opts.get('program') | program = opts.get('program') | ||||
option = opts.get('option') | option = opts.get('option') | ||||
if not program: | if not program: | ||||
When two revision arguments are given, then changes are shown | When two revision arguments are given, then changes are shown | ||||
between those revisions. If only one revision is specified then | between those revisions. If only one revision is specified then | ||||
that revision is compared to the working directory, and, when no | that revision is compared to the working directory, and, when no | ||||
revisions are specified, the working directory files are compared | revisions are specified, the working directory files are compared | ||||
to its parent. | to its parent. | ||||
""" | """ | ||||
def __init__(self, path, cmdline): | def __init__(self, path, cmdline, isgui): | ||||
# We can't pass non-ASCII through docstrings (and path is | # We can't pass non-ASCII through docstrings (and path is | ||||
# in an unknown encoding anyway), but avoid double separators on | # in an unknown encoding anyway), but avoid double separators on | ||||
# Windows | # Windows | ||||
docpath = stringutil.escapestr(path).replace(b'\\\\', b'\\') | docpath = stringutil.escapestr(path).replace(b'\\\\', b'\\') | ||||
self.__doc__ %= {r'path': pycompat.sysstr(stringutil.uirepr(docpath))} | self.__doc__ %= {r'path': pycompat.sysstr(stringutil.uirepr(docpath))} | ||||
self._cmdline = cmdline | self._cmdline = cmdline | ||||
self._isgui = isgui | |||||
def __call__(self, ui, repo, *pats, **opts): | def __call__(self, ui, repo, *pats, **opts): | ||||
opts = pycompat.byteskwargs(opts) | opts = pycompat.byteskwargs(opts) | ||||
options = ' '.join(map(procutil.shellquote, opts['option'])) | options = ' '.join(map(procutil.shellquote, opts['option'])) | ||||
if options: | if options: | ||||
options = ' ' + options | options = ' ' + options | ||||
return dodiff(ui, repo, self._cmdline + options, pats, opts) | return dodiff(ui, repo, self._cmdline + options, pats, opts, | ||||
guitool=self._isgui) | |||||
def uisetup(ui): | def uisetup(ui): | ||||
for cmd, path in ui.configitems('extdiff'): | for cmd, path in ui.configitems('extdiff'): | ||||
path = util.expandpath(path) | path = util.expandpath(path) | ||||
if cmd.startswith('cmd.'): | if cmd.startswith('cmd.'): | ||||
cmd = cmd[4:] | cmd = cmd[4:] | ||||
if not path: | if not path: | ||||
path = procutil.findexe(cmd) | path = procutil.findexe(cmd) | ||||
if path is None: | if path is None: | ||||
path = filemerge.findexternaltool(ui, cmd) or cmd | path = filemerge.findexternaltool(ui, cmd) or cmd | ||||
diffopts = ui.config('extdiff', 'opts.' + cmd) | diffopts = ui.config('extdiff', 'opts.' + cmd) | ||||
cmdline = procutil.shellquote(path) | cmdline = procutil.shellquote(path) | ||||
if diffopts: | if diffopts: | ||||
cmdline += ' ' + diffopts | cmdline += ' ' + diffopts | ||||
elif cmd.startswith('opts.'): | isgui = ui.configbool('extdiff', 'gui.' + cmd) | ||||
elif cmd.startswith('opts.') or cmd.startswith('gui.'): | |||||
continue | continue | ||||
else: | else: | ||||
if path: | if path: | ||||
# case "cmd = path opts" | # case "cmd = path opts" | ||||
cmdline = path | cmdline = path | ||||
diffopts = len(pycompat.shlexsplit(cmdline)) > 1 | diffopts = len(pycompat.shlexsplit(cmdline)) > 1 | ||||
else: | else: | ||||
# case "cmd =" | # case "cmd =" | ||||
path = procutil.findexe(cmd) | path = procutil.findexe(cmd) | ||||
if path is None: | if path is None: | ||||
path = filemerge.findexternaltool(ui, cmd) or cmd | path = filemerge.findexternaltool(ui, cmd) or cmd | ||||
cmdline = procutil.shellquote(path) | cmdline = procutil.shellquote(path) | ||||
diffopts = False | diffopts = False | ||||
isgui = ui.configbool('extdiff', 'gui.' + cmd) | |||||
# look for diff arguments in [diff-tools] then [merge-tools] | # look for diff arguments in [diff-tools] then [merge-tools] | ||||
if not diffopts: | if not diffopts: | ||||
args = ui.config('diff-tools', cmd+'.diffargs') or \ | key = cmd + '.diffargs' | ||||
ui.config('merge-tools', cmd+'.diffargs') | for section in ('diff-tools', 'merge-tools'): | ||||
args = ui.config(section, key) | |||||
if args: | if args: | ||||
cmdline += ' ' + args | cmdline += ' ' + args | ||||
if isgui is None: | |||||
isgui = ui.configbool(section, cmd + '.gui') or False | |||||
break | |||||
command(cmd, extdiffopts[:], _('hg %s [OPTION]... [FILE]...') % cmd, | command(cmd, extdiffopts[:], _('hg %s [OPTION]... [FILE]...') % cmd, | ||||
helpcategory=command.CATEGORY_FILE_CONTENTS, | helpcategory=command.CATEGORY_FILE_CONTENTS, | ||||
inferrepo=True)(savedcmd(path, cmdline)) | inferrepo=True)(savedcmd(path, cmdline, isgui)) | ||||
# tell hggettext to extract docstrings from these functions: | # tell hggettext to extract docstrings from these functions: | ||||
i18nfunctions = [savedcmd] | i18nfunctions = [savedcmd] |
[1] | [1] | ||||
$ cat <<EOF >> $HGRCPATH | $ cat <<EOF >> $HGRCPATH | ||||
> [extdiff] | > [extdiff] | ||||
> cmd.falabala = echo | > cmd.falabala = echo | ||||
> opts.falabala = diffing | > opts.falabala = diffing | ||||
> cmd.edspace = echo | > cmd.edspace = echo | ||||
> opts.edspace = "name <user@example.com>" | > opts.edspace = "name <user@example.com>" | ||||
> alabalaf = | |||||
> [merge-tools] | |||||
> alabalaf.executable = echo | |||||
> alabalaf.diffargs = diffing | |||||
> EOF | > EOF | ||||
$ hg falabala | $ hg falabala | ||||
diffing a.000000000000 a | diffing a.000000000000 a | ||||
[1] | [1] | ||||
$ hg help falabala | $ hg help falabala | ||||
hg falabala [OPTION]... [FILE]... | hg falabala [OPTION]... [FILE]... | ||||
created new head | created new head | ||||
$ hg falabala -c 6 --per-file | $ hg falabala -c 6 --per-file | ||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) | diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) | ||||
diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) | diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) | ||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) | diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) | ||||
diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) | diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) | ||||
[1] | [1] | ||||
Test --per-file option for gui tool: | |||||
$ hg --config extdiff.gui.alabalaf=True alabalaf -c 6 --per-file --debug | |||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) | |||||
diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) | |||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) | |||||
diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) | |||||
making snapshot of 2 files from rev 46c0e4daeb72 | |||||
a | |||||
b | |||||
making snapshot of 2 files from rev 81906f2b98ac | |||||
a | |||||
b | |||||
running '* diffing * *' in * (backgrounded) (glob) | |||||
running '* diffing * *' in * (backgrounded) (glob) | |||||
cleaning up temp directory | |||||
[1] | |||||
Test --per-file option for gui tool again: | |||||
$ hg --config merge-tools.alabalaf.gui=True alabalaf -c 6 --per-file --debug | |||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\a" "a.81906f2b98ac\\a" (glob) (windows !) | |||||
diffing */extdiff.*/a.46c0e4daeb72/a a.81906f2b98ac/a (glob) (no-windows !) | |||||
diffing "*\\extdiff.*\\a.46c0e4daeb72\\b" "a.81906f2b98ac\\b" (glob) (windows !) | |||||
diffing */extdiff.*/a.46c0e4daeb72/b a.81906f2b98ac/b (glob) (no-windows !) | |||||
making snapshot of 2 files from rev 46c0e4daeb72 | |||||
a | |||||
b | |||||
making snapshot of 2 files from rev 81906f2b98ac | |||||
a | |||||
b | |||||
running '* diffing * *' in * (backgrounded) (glob) | |||||
running '* diffing * *' in * (backgrounded) (glob) | |||||
cleaning up temp directory | |||||
[1] | |||||
Test --per-file and --confirm options: | Test --per-file and --confirm options: | ||||
$ hg --config ui.interactive=True falabala -c 6 --per-file --confirm <<EOF | $ hg --config ui.interactive=True falabala -c 6 --per-file --confirm <<EOF | ||||
> n | > n | ||||
> y | > y | ||||
> EOF | > EOF | ||||
diff a (1 of 2) [Yns?] n | diff a (1 of 2) [Yns?] n | ||||
diff b (2 of 2) [Yns?] y | diff b (2 of 2) [Yns?] y |
directories or files to compare. | directories or files to compare. | ||||
When two revision arguments are given, then changes are shown between | When two revision arguments are given, then changes are shown between | ||||
those revisions. If only one revision is specified then that revision is | those revisions. If only one revision is specified then that revision is | ||||
compared to the working directory, and, when no revisions are specified, | compared to the working directory, and, when no revisions are specified, | ||||
the working directory files are compared to its parent. | the working directory files are compared to its parent. | ||||
The --per-file option runs the external program repeatedly on each file to | The --per-file option runs the external program repeatedly on each file to | ||||
diff, instead of once on two directories. | 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 | The --confirm option will prompt the user before each invocation of the | ||||
external program. It is ignored if --per-file isn't specified. | external program. It is ignored if --per-file isn't specified. | ||||
(use 'hg help -e extdiff' to show help for the extdiff extension) | (use 'hg help -e extdiff' to show help for the extdiff extension) | ||||
options ([+] can be repeated): | options ([+] can be repeated): | ||||
sections for diff tool arguments, when none are specified in [extdiff]. | sections for diff tool arguments, when none are specified in [extdiff]. | ||||
[extdiff] | [extdiff] | ||||
kdiff3 = | kdiff3 = | ||||
[diff-tools] | [diff-tools] | ||||
kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child | 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' | 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 | command. The extdiff extension makes snapshots of only needed files, so | ||||
running the external diff program will actually be pretty fast (at least | running the external diff program will actually be pretty fast (at least | ||||
faster than having to compare the entire tree). | faster than having to compare the entire tree). | ||||
list of commands: | list of commands: | ||||
extdiff use external program to diff repository (or selected files) | extdiff use external program to diff repository (or selected files) |