mq: use the newcommitphase utility
authorBoris Feld <boris.feld@octobus.net>
Mon, 09 Oct 2017 17:33:03 +0200
changeset 34562 c2d2e18f9700
parent 34561 fe6125ebdf91
child 34563 1faa34347b24
mq: use the newcommitphase utility We use the official API instead of doing the operation manually. This will help storing the default value for phases properly in the next changeset.
hgext/mq.py
--- a/hgext/mq.py	Tue Sep 26 18:17:47 2017 +0200
+++ b/hgext/mq.py	Mon Oct 09 17:33:03 2017 +0200
@@ -1065,7 +1065,7 @@
         if qfinished and repo.ui.configbool('mq', 'secret'):
             # only use this logic when the secret option is added
             oldqbase = repo[qfinished[0]]
-            tphase = repo.ui.config('phases', 'new-commit', phases.draft)
+            tphase = phases.newcommitphase(repo.ui)
             if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase:
                 with repo.transaction('qfinish') as tr:
                     phases.advanceboundary(repo, tr, tphase, qfinished)