comparison mercurial/commands.py @ 9646:5b001f534452

commands: adding --no-status to resolve to match status
author timeless <timeless@gmail.com>
date Sun, 25 Oct 2009 13:27:54 +0100
parents 02f40b2ece3f
children 20b91f91f9ca
comparison
equal deleted inserted replaced
9645:02f40b2ece3f 9646:5b001f534452
2443 wlock.release() 2443 wlock.release()
2444 2444
2445 def resolve(ui, repo, *pats, **opts): 2445 def resolve(ui, repo, *pats, **opts):
2446 """retry file merges from a merge or update 2446 """retry file merges from a merge or update
2447 2447
2448 This command will cleanly retry unresolved file merges using file 2448 This command can cleanly retry unresolved file merges using file
2449 revisions preserved from the last update or merge. To attempt to 2449 revisions preserved from the last update or merge. To attempt to
2450 resolve all unresolved files, use the -a/--all switch. 2450 resolve all unresolved files, use the -a/--all switch.
2451 2451
2452 If a conflict is resolved manually, please note that the changes 2452 If a conflict is resolved manually, please note that the changes
2453 will be overwritten if the merge is retried with resolve. The 2453 will be overwritten if the merge is retried with resolve. The
2461 2461
2462 U = unresolved 2462 U = unresolved
2463 R = resolved 2463 R = resolved
2464 """ 2464 """
2465 2465
2466 all, mark, unmark, show = [opts.get(o) for o in 'all mark unmark list'.split()] 2466 all, mark, unmark, show, nostatus = \
2467 [opts.get(o) for o in 'all mark unmark list no_status'.split()]
2467 2468
2468 if (show and (mark or unmark)) or (mark and unmark): 2469 if (show and (mark or unmark)) or (mark and unmark):
2469 raise util.Abort(_("too many options specified")) 2470 raise util.Abort(_("too many options specified"))
2470 if pats and all: 2471 if pats and all:
2471 raise util.Abort(_("can't specify --all and patterns")) 2472 raise util.Abort(_("can't specify --all and patterns"))
2477 m = cmdutil.match(repo, pats, opts) 2478 m = cmdutil.match(repo, pats, opts)
2478 2479
2479 for f in ms: 2480 for f in ms:
2480 if m(f): 2481 if m(f):
2481 if show: 2482 if show:
2482 ui.write("%s %s\n" % (ms[f].upper(), f)) 2483 if nostatus:
2484 ui.write("%s\n" % f)
2485 else:
2486 ui.write("%s %s\n" % (ms[f].upper(), f))
2483 elif mark: 2487 elif mark:
2484 ms.mark(f, "r") 2488 ms.mark(f, "r")
2485 elif unmark: 2489 elif unmark:
2486 ms.mark(f, "u") 2490 ms.mark(f, "u")
2487 else: 2491 else:
3584 "resolve": 3588 "resolve":
3585 (resolve, 3589 (resolve,
3586 [('a', 'all', None, _('remerge all unresolved files')), 3590 [('a', 'all', None, _('remerge all unresolved files')),
3587 ('l', 'list', None, _('list state of files needing merge')), 3591 ('l', 'list', None, _('list state of files needing merge')),
3588 ('m', 'mark', None, _('mark files as resolved')), 3592 ('m', 'mark', None, _('mark files as resolved')),
3589 ('u', 'unmark', None, _('unmark files as resolved'))] 3593 ('u', 'unmark', None, _('unmark files as resolved')),
3594 ('n', 'no-status', None, _('hide status prefix'))]
3590 + walkopts, 3595 + walkopts,
3591 _('[OPTION]... [FILE]...')), 3596 _('[OPTION]... [FILE]...')),
3592 "revert": 3597 "revert":
3593 (revert, 3598 (revert,
3594 [('a', 'all', None, _('revert all changes when no arguments given')), 3599 [('a', 'all', None, _('revert all changes when no arguments given')),