comparison mercurial/commands.py @ 14852:cac04f2f475b

commands: use mergetoolopts when a command supports --tool
author Martin Geisler <mg@aragost.com>
date Thu, 07 Jul 2011 10:19:37 +0200
parents 11b5a5d2ca8b
children 4731d61cd36b
comparison
equal deleted inserted replaced
14848:09c9c120a817 14852:cac04f2f475b
117 ('U', 'unified', '', 117 ('U', 'unified', '',
118 _('number of lines of context to show'), _('NUM')), 118 _('number of lines of context to show'), _('NUM')),
119 ('', 'stat', None, _('output diffstat-style summary of changes')), 119 ('', 'stat', None, _('output diffstat-style summary of changes')),
120 ] 120 ]
121 121
122 mergetoolopts = [
123 ('t', 'tool', '', _('specify merge tool')),
124 ]
125
122 similarityopts = [ 126 similarityopts = [
123 ('s', 'similarity', '', 127 ('s', 'similarity', '',
124 _('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY')) 128 _('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY'))
125 ] 129 ]
126 130
347 matchfn, prefix, subrepos=opts.get('subrepos')) 351 matchfn, prefix, subrepos=opts.get('subrepos'))
348 352
349 @command('backout', 353 @command('backout',
350 [('', 'merge', None, _('merge with old dirstate parent after backout')), 354 [('', 'merge', None, _('merge with old dirstate parent after backout')),
351 ('', 'parent', '', _('parent to choose when backing out merge'), _('REV')), 355 ('', 'parent', '', _('parent to choose when backing out merge'), _('REV')),
352 ('t', 'tool', '', _('specify merge tool')),
353 ('r', 'rev', '', _('revision to backout'), _('REV')), 356 ('r', 'rev', '', _('revision to backout'), _('REV')),
354 ] + walkopts + commitopts + commitopts2, 357 ] + mergetoolopts + walkopts + commitopts + commitopts2,
355 _('[OPTION]... [-r] REV')) 358 _('[OPTION]... [-r] REV'))
356 def backout(ui, repo, node=None, rev=None, **opts): 359 def backout(ui, repo, node=None, rev=None, **opts):
357 '''reverse effect of earlier changeset 360 '''reverse effect of earlier changeset
358 361
359 Prepare a new changeset with the effect of REV undone in the 362 Prepare a new changeset with the effect of REV undone in the
3503 ui.write(decor[ctx.flags(f)]) 3506 ui.write(decor[ctx.flags(f)])
3504 ui.write("%s\n" % f) 3507 ui.write("%s\n" % f)
3505 3508
3506 @command('^merge', 3509 @command('^merge',
3507 [('f', 'force', None, _('force a merge with outstanding changes')), 3510 [('f', 'force', None, _('force a merge with outstanding changes')),
3508 ('t', 'tool', '', _('specify merge tool')),
3509 ('r', 'rev', '', _('revision to merge'), _('REV')), 3511 ('r', 'rev', '', _('revision to merge'), _('REV')),
3510 ('P', 'preview', None, 3512 ('P', 'preview', None,
3511 _('review revisions to merge (no merge is performed)'))], 3513 _('review revisions to merge (no merge is performed)'))
3514 ] + mergetoolopts,
3512 _('[-P] [-f] [[-r] REV]')) 3515 _('[-P] [-f] [[-r] REV]'))
3513 def merge(ui, repo, node=None, **opts): 3516 def merge(ui, repo, node=None, **opts):
3514 """merge working directory with another revision 3517 """merge working directory with another revision
3515 3518
3516 The current working directory is updated with all changes made in 3519 The current working directory is updated with all changes made in
4047 @command('resolve', 4050 @command('resolve',
4048 [('a', 'all', None, _('select all unresolved files')), 4051 [('a', 'all', None, _('select all unresolved files')),
4049 ('l', 'list', None, _('list state of files needing merge')), 4052 ('l', 'list', None, _('list state of files needing merge')),
4050 ('m', 'mark', None, _('mark files as resolved')), 4053 ('m', 'mark', None, _('mark files as resolved')),
4051 ('u', 'unmark', None, _('mark files as unresolved')), 4054 ('u', 'unmark', None, _('mark files as unresolved')),
4052 ('t', 'tool', '', _('specify merge tool')),
4053 ('n', 'no-status', None, _('hide status prefix'))] 4055 ('n', 'no-status', None, _('hide status prefix'))]
4054 + walkopts, 4056 + mergetoolopts + walkopts,
4055 _('[OPTION]... [FILE]...')) 4057 _('[OPTION]... [FILE]...'))
4056 def resolve(ui, repo, *pats, **opts): 4058 def resolve(ui, repo, *pats, **opts):
4057 """redo merges or set/view the merge status of files 4059 """redo merges or set/view the merge status of files
4058 4060
4059 Merges with unresolved conflicts are often the result of 4061 Merges with unresolved conflicts are often the result of