config: use the 'config' method in 'configsuboptions'
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 17 Jun 2017 18:28:20 +0200
changeset 32966 61a8321c9962
parent 32965 36e16797df32
child 32967 cd2fd1765654
config: use the 'config' method in 'configsuboptions' There was unnecessary code duplication. It was getting in the way of the unification of the default value logic.
mercurial/ui.py
--- a/mercurial/ui.py	Sat Jun 17 12:52:02 2017 +0200
+++ b/mercurial/ui.py	Sat Jun 17 18:28:20 2017 +0200
@@ -470,14 +470,8 @@
         Returns a 2-tuple of ``(option, sub-options)``, where `sub-options``
         is a dict of defined sub-options where keys and values are strings.
         """
+        main = self.config(section, name, default, untrusted=untrusted)
         data = self._data(untrusted)
-        main = data.get(section, name, default)
-        if self.debugflag and not untrusted and self._reportuntrusted:
-            uvalue = self._ucfg.get(section, name)
-            if uvalue is not None and uvalue != main:
-                self.debug('ignoring untrusted configuration option '
-                           '%s.%s = %s\n' % (section, name, uvalue))
-
         sub = {}
         prefix = '%s:' % name
         for k, v in data.items(section):