comparison mercurial/commands.py @ 18685:fafdff7e9c43

backout: use cmdutil.revert directly instead of commands.revert Before this change, backout would explicitly set the options it passed to commands.revert in order to fall thru most of its logic and call cmdutil.revert. This change makes it clearer what backup is trying to accomplish and makes it robust against changes to the revert command.
author Kevin Bullock <kbullock@ringworld.org>
date Tue, 12 Feb 2013 15:07:17 +0000
parents 5e63a85299ba
children 0bca4d31f647
comparison
equal deleted inserted replaced
18684:c161e4cf77d4 18685:fafdff7e9c43
456 wlock = repo.wlock() 456 wlock = repo.wlock()
457 try: 457 try:
458 branch = repo.dirstate.branch() 458 branch = repo.dirstate.branch()
459 hg.clean(repo, node, show_stats=False) 459 hg.clean(repo, node, show_stats=False)
460 repo.dirstate.setbranch(branch) 460 repo.dirstate.setbranch(branch)
461 revert_opts = opts.copy() 461 rctx = scmutil.revsingle(repo, hex(parent))
462 revert_opts['date'] = None 462 cmdutil.revert(ui, repo, rctx, repo.dirstate.parents())
463 revert_opts['all'] = True
464 revert_opts['rev'] = hex(parent)
465 revert_opts['no_backup'] = None
466 revert(ui, repo, **revert_opts)
467 if not opts.get('merge') and op1 != node: 463 if not opts.get('merge') and op1 != node:
468 try: 464 try:
469 ui.setconfig('ui', 'forcemerge', opts.get('tool', '')) 465 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))
470 return hg.update(repo, op1) 466 return hg.update(repo, op1)
471 finally: 467 finally: