# HG changeset patch # User Pierre-Yves David # Date 1497716900 -7200 # Node ID 61a8321c996266f23d83fb8531441e36e0129094 # Parent 36e16797df32a1db2fbe58503b5a08edd1020854 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. diff -r 36e16797df32 -r 61a8321c9962 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):