changeset 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 c161e4cf77d4
children 0bca4d31f647
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Feb 13 15:09:43 2013 -0600
+++ b/mercurial/commands.py	Tue Feb 12 15:07:17 2013 +0000
@@ -458,12 +458,8 @@
         branch = repo.dirstate.branch()
         hg.clean(repo, node, show_stats=False)
         repo.dirstate.setbranch(branch)
-        revert_opts = opts.copy()
-        revert_opts['date'] = None
-        revert_opts['all'] = True
-        revert_opts['rev'] = hex(parent)
-        revert_opts['no_backup'] = None
-        revert(ui, repo, **revert_opts)
+        rctx = scmutil.revsingle(repo, hex(parent))
+        cmdutil.revert(ui, repo, rctx, repo.dirstate.parents())
         if not opts.get('merge') and op1 != node:
             try:
                 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''))