graft: move rebase cleanup code next to actual rebase
This is prep for refactoring the rebase logic.
--- 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)