backout: use cmdutil.revert directly instead of commands.revert
authorKevin Bullock <kbullock@ringworld.org>
Tue, 12 Feb 2013 15:07:17 +0000
changeset 18685 fafdff7e9c43
parent 18684 c161e4cf77d4
child 18686 0bca4d31f647
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.
mercurial/commands.py
--- 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', ''))