hgext3rd/topic/__init__.py
changeset 3040 a05b6580f71c
parent 3038 103244e34a9c
child 3057 cb8ae3cb0bbc
--- a/hgext3rd/topic/__init__.py	Thu Oct 05 19:30:22 2017 +0530
+++ b/hgext3rd/topic/__init__.py	Thu Oct 05 19:35:58 2017 +0530
@@ -721,17 +721,28 @@
             p1 = successors[p1][0]
         if p2 in successors:
             p2 = successors[p2][0]
-        mc = context.memctx(
-            repo, (p1, p2), c.description(),
-            c.files(), filectxfn,
-            user=c.user(), date=c.date(), extra=fixedextra)
-        newnode = repo.commitctx(mc)
+        mc = context.memctx(repo,
+                            (p1, p2),
+                            c.description(),
+                            c.files(),
+                            filectxfn,
+                            user=c.user(),
+                            date=c.date(),
+                            extra=fixedextra)
+
+        # phase handling
+        commitphase = c.phase()
+        overrides = {('phases', 'new-commit'): commitphase}
+        with repo.ui.configoverride(overrides, 'changetopic'):
+            newnode = repo.commitctx(mc)
+
         successors[c.node()] = (newnode,)
         ui.debug('new node id is %s\n' % node.hex(newnode))
         rewrote += 1
 
     # create obsmarkers and move bookmarks
     scmutil.cleanupnodes(repo, successors, 'changetopics')
+
     # move the working copy too
     wctx = repo[None]
     # in-progress merge is a bit too complex for now.