mercurial/cmdutil.py
branchstable
changeset 17461 bacde764fba0
parent 17391 fc24c10424d2
child 17468 8fea378242e3
--- a/mercurial/cmdutil.py	Fri Sep 07 00:42:42 2012 +0900
+++ b/mercurial/cmdutil.py	Thu Aug 30 16:47:08 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("|")
@@ -1668,7 +1668,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)