##// END OF EJS Templates
revsetbenchmarks: use a more compact output format with a header...
revsetbenchmarks: use a more compact output format with a header We change the output from: revset #0: draft() 0) wall 0.011989 comb 0.010000 user 0.000000 sys 0.010000 (best of 177) 1) wall 0.012226 comb 0.010000 user 0.000000 sys 0.010000 (best of 193) 2) wall 0.011838 comb 0.020000 user 0.000000 sys 0.020000 (best of 208) to: revset #0: draft() wall comb user sys count 0) 0.012028 0.010000 0.000000 0.010000 170 1) 0.012218 0.010000 0.000000 0.010000 157 2) 0.012622 0.010000 0.000000 0.010000 189 This opens the road to more useful output.

File last commit:

r22023:f1883065 default
r25534:43e5a681 default
Show More
simplemerge
66 lines | 2.1 KiB | text/plain | TextLexer
Alexis S. L. Carvalho
actually port simplemerge to hg...
r4363 #!/usr/bin/env python
Alexis S. L. Carvalho
Import 3-way merge code from bzr...
r4362
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 from mercurial import demandimport
demandimport.enable()
Alexis S. L. Carvalho
Import 3-way merge code from bzr...
r4362
Simon Heimberg
cleanup: drop unused variables and an unused import
r19378 import sys
Alexis S. L. Carvalho
actually port simplemerge to hg...
r4363 from mercurial.i18n import _
Steve Borho
simplemerge: use ui.warn() for warnings
r8269 from mercurial import simplemerge, fancyopts, util, ui
Alexis S. L. Carvalho
Import 3-way merge code from bzr...
r4362
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 options = [('L', 'label', [], _('labels to use on conflict markers')),
('a', 'text', None, _('treat all files as text')),
('p', 'print', None,
_('print results instead of overwriting LOCAL')),
Pierre-Yves David
simplemerge: burn "minimal" feature to the ground...
r22023 ('', 'no-minimal', None, _('no effect (DEPRECATED)')),
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 ('h', 'help', None, _('display help and exit')),
('q', 'quiet', None, _('suppress output'))]
usage = _('''simplemerge [OPTS] LOCAL BASE OTHER
Simple three-way file merge utility with a minimal feature set.
Thomas Arendsen Hein
Remove trailing spaces
r5081
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 Apply to LOCAL the changes necessary to go from BASE to OTHER.
Thomas Arendsen Hein
Remove trailing spaces
r5081
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 By default, LOCAL is overwritten with the results of this operation.
''')
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 class ParseError(Exception):
"""Exception raised on errors in parsing the command line."""
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 def showhelp():
sys.stdout.write(usage)
sys.stdout.write('\noptions:\n')
Alexis S. L. Carvalho
Import 3-way merge code from bzr...
r4362
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 out_opts = []
for shortopt, longopt, default, desc in options:
out_opts.append(('%2s%s' % (shortopt and '-%s' % shortopt,
longopt and ' --%s' % longopt),
'%s' % desc))
opts_len = max([len(opt[0]) for opt in out_opts])
for first, second in out_opts:
sys.stdout.write(' %-*s %s\n' % (opts_len, first, second))
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 try:
Patrick Mezard
tests: Windows compatibility fixes...
r7080 for fp in (sys.stdin, sys.stdout, sys.stderr):
Adrian Buehlmann
rename util.set_binary to setbinary
r14233 util.setbinary(fp)
Mads Kiilerich
tests: run check-code on Python files without .py extension
r19022
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 opts = {}
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 try:
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 args = fancyopts.fancyopts(sys.argv[1:], options, opts)
except fancyopts.getopt.GetoptError, e:
raise ParseError(e)
if opts['help']:
Alexis S. L. Carvalho
polish the simplemerge command; add a test
r4364 showhelp()
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 sys.exit(0)
if len(args) != 3:
raise ParseError(_('wrong number of arguments'))
Steve Borho
simplemerge: use ui.warn() for warnings
r8269 sys.exit(simplemerge.simplemerge(ui.ui(), *args, **opts))
Matt Mackall
merge: move the bulk of simplemerge into core...
r6002 except ParseError, e:
sys.stdout.write("%s: %s\n" % (sys.argv[0], e))
showhelp()
sys.exit(1)
except util.Abort, e:
sys.stderr.write("abort: %s\n" % e)
sys.exit(255)
except KeyboardInterrupt:
sys.exit(255)