[PATCH 2 of 4] config: use '_config' within 'configbool'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sun Jun 25 12:34:39 EDT 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1498394336 -7200
#      Sun Jun 25 14:38:56 2017 +0200
# Node ID 561dc45d7a7f23a1f085682bdcc5604cbde963fb
# Parent  290508394c236b288e1b2ebf3d60a28843f9fa00
# EXP-Topic config.register
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 561dc45d7a7f
config: use '_config' within 'configbool'

This will prevent bugs from using None as the sentinel value (eg:
'ui.interactive')

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -540,8 +540,10 @@ class ui(object):
         ConfigError: foo.invalid is not a boolean ('somevalue')
         """
 
-        v = self.config(section, name, default, untrusted=untrusted)
+        v = self._config(section, name, default, untrusted=untrusted)
         if v is None:
+            return v
+        if v is _unset:
             if default is _unset:
                 return False
             return default


More information about the Mercurial-devel mailing list