Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG1dd82ecb869b: py3: use pycompat.strkwargs() in contrib/simplemerge
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
#!/usr/bin/env python | #!/usr/bin/env python | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
import getopt | import getopt | ||||
import sys | import sys | ||||
import hgdemandimport | import hgdemandimport | ||||
hgdemandimport.enable() | hgdemandimport.enable() | ||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial import ( | from mercurial import ( | ||||
context, | context, | ||||
error, | error, | ||||
fancyopts, | fancyopts, | ||||
pycompat, | |||||
simplemerge, | simplemerge, | ||||
ui as uimod, | ui as uimod, | ||||
) | ) | ||||
from mercurial.utils import ( | from mercurial.utils import ( | ||||
procutil, | procutil, | ||||
) | ) | ||||
options = [(b'L', b'label', [], _(b'labels to use on conflict markers')), | options = [(b'L', b'label', [], _(b'labels to use on conflict markers')), | ||||
sys.exit(0) | sys.exit(0) | ||||
if len(args) != 3: | if len(args) != 3: | ||||
raise ParseError(_(b'wrong number of arguments')) | raise ParseError(_(b'wrong number of arguments')) | ||||
local, base, other = args | local, base, other = args | ||||
sys.exit(simplemerge.simplemerge(uimod.ui.load(), | sys.exit(simplemerge.simplemerge(uimod.ui.load(), | ||||
context.arbitraryfilectx(local), | context.arbitraryfilectx(local), | ||||
context.arbitraryfilectx(base), | context.arbitraryfilectx(base), | ||||
context.arbitraryfilectx(other), | context.arbitraryfilectx(other), | ||||
**opts)) | **pycompat.strkwargs(opts))) | ||||
except ParseError as e: | except ParseError as e: | ||||
sys.stdout.write(b"%s: %s\n" % (sys.argv[0], e)) | sys.stdout.write(b"%s: %s\n" % (sys.argv[0], e)) | ||||
showhelp() | showhelp() | ||||
sys.exit(1) | sys.exit(1) | ||||
except error.Abort as e: | except error.Abort as e: | ||||
sys.stderr.write(b"abort: %s\n" % e) | sys.stderr.write(b"abort: %s\n" % e) | ||||
sys.exit(255) | sys.exit(255) | ||||
except KeyboardInterrupt: | except KeyboardInterrupt: | ||||
sys.exit(255) | sys.exit(255) |