changeset 22899:67cb1ab1ad1d

graft: move rebase cleanup code next to actual rebase This is prep for refactoring the rebase logic.
author Matt Mackall <mpm@selenic.com>
date Mon, 13 Oct 2014 13:21:03 -0500
parents 43816070284e
children 7bf82faba774
files mercurial/commands.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Oct 10 13:44:40 2014 -0500
+++ b/mercurial/commands.py	Mon Oct 13 13:21:03 2014 -0500
@@ -3485,6 +3485,13 @@
                     stats = mergemod.update(repo, ctx.node(), True, True, False,
                                             ctx.p1().node(),
                                             labels=['local', 'graft'])
+                    # drop the second merge parent
+                    repo.dirstate.beginparentchange()
+                    repo.setparents(current.node(), nullid)
+                    repo.dirstate.write()
+                    # fix up dirstate for copies and renames
+                    cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev())
+                    repo.dirstate.endparentchange()
                 finally:
                     repo.ui.setconfig('ui', 'forcemerge', '', 'graft')
                 # report any conflicts
@@ -3498,14 +3505,6 @@
             else:
                 cont = False
 
-            # drop the second merge parent
-            repo.dirstate.beginparentchange()
-            repo.setparents(current.node(), nullid)
-            repo.dirstate.write()
-            # fix up dirstate for copies and renames
-            cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev())
-            repo.dirstate.endparentchange()
-
             # commit
             node = repo.commit(text=message, user=user,
                         date=date, extra=extra, editor=editor)