Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHGa8bc191fee5a: py3: handle keyword arguments in hgext/extdiff.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
pass additional options to the program, use -o/--option. These | pass additional options to the program, use -o/--option. These | ||||
will be passed before the names of the directories to compare. | will be passed before the names of the directories to compare. | ||||
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.''' | ||||
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: | ||||
program = 'diff' | program = 'diff' | ||||
option = option or ['-Npru'] | option = option or ['-Npru'] | ||||
cmdline = ' '.join(map(util.shellquote, [program] + option)) | cmdline = ' '.join(map(util.shellquote, [program] + option)) | ||||
return dodiff(ui, repo, cmdline, pats, opts) | return dodiff(ui, repo, cmdline, pats, opts) | ||||
def __init__(self, path, cmdline): | def __init__(self, path, cmdline): | ||||
# 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) | # in an unknown encoding anyway) | ||||
docpath = util.escapestr(path) | docpath = util.escapestr(path) | ||||
self.__doc__ = self.__doc__ % {'path': util.uirepr(docpath)} | self.__doc__ = self.__doc__ % {'path': util.uirepr(docpath)} | ||||
self._cmdline = cmdline | self._cmdline = cmdline | ||||
def __call__(self, ui, repo, *pats, **opts): | def __call__(self, ui, repo, *pats, **opts): | ||||
opts = pycompat.byteskwargs(opts) | |||||
options = ' '.join(map(util.shellquote, opts['option'])) | options = ' '.join(map(util.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) | ||||
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) |