Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGcdccfe20eed7: py3: use pycompat.byteskwargs() in tests/autodiff.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
# Extension dedicated to test patch.diff() upgrade modes | # Extension dedicated to test patch.diff() upgrade modes | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
from mercurial import ( | from mercurial import ( | ||||
error, | error, | ||||
patch, | patch, | ||||
pycompat, | |||||
registrar, | registrar, | ||||
scmutil, | scmutil, | ||||
) | ) | ||||
cmdtable = {} | cmdtable = {} | ||||
command = registrar.command(cmdtable) | command = registrar.command(cmdtable) | ||||
@command(b'autodiff', | @command(b'autodiff', | ||||
[(b'', b'git', b'', b'git upgrade mode (yes/no/auto/warn/abort)')], | [(b'', b'git', b'', b'git upgrade mode (yes/no/auto/warn/abort)')], | ||||
b'[OPTION]... [FILE]...') | b'[OPTION]... [FILE]...') | ||||
def autodiff(ui, repo, *pats, **opts): | def autodiff(ui, repo, *pats, **opts): | ||||
opts = pycompat.byteskwargs(opts) | |||||
diffopts = patch.difffeatureopts(ui, opts) | diffopts = patch.difffeatureopts(ui, opts) | ||||
git = opts.get(b'git', b'no') | git = opts.get(b'git', b'no') | ||||
brokenfiles = set() | brokenfiles = set() | ||||
losedatafn = None | losedatafn = None | ||||
if git in (b'yes', b'no'): | if git in (b'yes', b'no'): | ||||
diffopts.git = git == b'yes' | diffopts.git = git == b'yes' | ||||
diffopts.upgrade = False | diffopts.upgrade = False | ||||
elif git == b'auto': | elif git == b'auto': |