Patchwork [1,of,2] mq: use the newcommitphase utility

login
register
mail settings
Submitter Boris Feld
Date Oct. 9, 2017, 3:51 p.m.
Message ID <a5d695caa0ad1b30d054.1507564278@FB>
Download mbox | patch
Permalink /patch/24658/
State Accepted
Headers show

Comments

Boris Feld - Oct. 9, 2017, 3:51 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.
Yuya Nishihara - Oct. 10, 2017, 1:37 p.m.
On Mon, 09 Oct 2017 17:51:18 +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@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

Queued, thanks.

Patch

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)