mercurial/cmdutil.py
changeset 17468 8fea378242e3
parent 17460 a306837f8c87
parent 17461 bacde764fba0
child 17471 ad1561723dde
--- a/mercurial/cmdutil.py	Sun Sep 09 12:31:14 2012 +0200
+++ b/mercurial/cmdutil.py	Sun Sep 09 12:35:06 2012 +0200
@@ -10,7 +10,7 @@
 import os, sys, errno, re, tempfile
 import util, scmutil, templater, patch, error, templatekw, revlog, copies
 import match as matchmod
-import subrepo, context, repair, bookmarks, graphmod, revset
+import subrepo, context, repair, bookmarks, graphmod, revset, phases
 
 def parsealiases(cmd):
     return cmd.lstrip("^").split("|")
@@ -1675,7 +1675,12 @@
                              user=user,
                              date=date,
                              extra=extra)
-        newid = repo.commitctx(new)
+        ph = repo.ui.config('phases', 'new-commit', phases.draft)
+        try:
+            repo.ui.setconfig('phases', 'new-commit', old.phase())
+            newid = repo.commitctx(new)
+        finally:
+            repo.ui.setconfig('phases', 'new-commit', ph)
         if newid != old.node():
             # Reroute the working copy parent to the new changeset
             repo.setparents(newid, nullid)