Comments
Patch
@@ -466,19 +466,22 @@ def concludenode(repo, rev, p1, p2, comm
if commitmsg is None:
commitmsg = ctx.description()
extra = {'rebase_source': ctx.hex()}
if extrafn:
extrafn(ctx, extra)
- # Commit might fail if unresolved files exist
- newrev = repo.commit(text=commitmsg, user=ctx.user(),
- date=ctx.date(), extra=extra, editor=editor)
+
+ backup = repo.ui.backupconfig('phases', 'new-commit')
+ try:
+ targetphase = max(ctx.phase(), phases.draft)
+ repo.ui.setconfig('phases', 'new-commit', targetphase, 'rebase')
+ # Commit might fail if unresolved files exist
+ newrev = repo.commit(text=commitmsg, user=ctx.user(),
+ date=ctx.date(), extra=extra, editor=editor)
+ finally:
+ repo.ui.restoreconfig(backup)
+
repo.dirstate.setbranch(repo[newrev].branch())
- targetphase = max(ctx.phase(), phases.draft)
- # retractboundary doesn't overwrite upper phase inherited from parent
- newnode = repo[newrev].node()
- if newnode:
- phases.retractboundary(repo, targetphase, [newnode])
return newrev
except util.Abort:
# Invalidate the previous setparents
repo.dirstate.invalidate()
raise