[PATCH 4 of 4] configitems: register the 'mq.secret' config

Boris Feld boris.feld at octobus.net
Wed Sep 13 06:31:15 UTC 2017


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1498786997 -7200
#      ven. juin 30 03:43:17 2017 +0200
# Node ID 548a81111ce3885acf89786890c944ac62276635
# Parent  50f09e900eb1a9b85b03c673922605fa4cebbe28
# EXP-Topic config.register.mq
configitems: register the 'mq.secret' config

diff -r 50f09e900eb1 -r 548a81111ce3 hgext/mq.py
--- a/hgext/mq.py	ven. juin 30 03:43:16 2017 +0200
+++ b/hgext/mq.py	ven. juin 30 03:43:17 2017 +0200
@@ -121,6 +121,9 @@
 configitem('mq', 'plain',
     default=False,
 )
+configitem('mq', 'secret',
+    default=False,
+)
 
 # force load strip extension formerly included in mq and import some utility
 try:
@@ -419,7 +422,7 @@
     """
     repo = repo.unfiltered()
     if phase is None:
-        if repo.ui.configbool('mq', 'secret', False):
+        if repo.ui.configbool('mq', 'secret'):
             phase = phases.secret
     overrides = {('ui', 'allowemptycommit'): True}
     if phase is not None:
@@ -1059,7 +1062,7 @@
         repo._phasecache
         patches = self._revpatches(repo, sorted(revs))
         qfinished = self._cleanup(patches, len(patches))
-        if qfinished and repo.ui.configbool('mq', 'secret', False):
+        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)
@@ -2164,7 +2167,7 @@
                     self.added.append(patchname)
                     imported.append(patchname)
                     patchname = None
-                    if rev and repo.ui.configbool('mq', 'secret', False):
+                    if rev and repo.ui.configbool('mq', 'secret'):
                         # if we added anything with --rev, move the secret root
                         phases.retractboundary(repo, tr, phases.secret, [n])
                     self.parseseries()
@@ -3423,7 +3426,7 @@
 def mqphasedefaults(repo, roots):
     """callback used to set mq changeset as secret when no phase data exists"""
     if repo.mq.applied:
-        if repo.ui.configbool('mq', 'secret', False):
+        if repo.ui.configbool('mq', 'secret'):
             mqphase = phases.secret
         else:
             mqphase = phases.draft



More information about the Mercurial-devel mailing list