[PATCH 1 of 2] mq: use the newcommitphase utility

Boris Feld boris.feld at octobus.net
Mon Oct 9 15:51:18 UTC 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1507563183 -7200
#      Mon Oct 09 17:33:03 2017 +0200
# Node ID a5d695caa0ad1b30d0542417472865cf0529059d
# Parent  8cef8f7d51d0f1e99889779ec1320d5c9c3b91de
# EXP-Topic config.register.followup
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r a5d695caa0ad
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.

diff -r 8cef8f7d51d0 -r a5d695caa0ad hgext/mq.py
--- a/hgext/mq.py	Thu Oct 05 20:41:50 2017 -0700
+++ 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)


More information about the Mercurial-devel mailing list