# HG changeset patch # User Pierre-Yves David # Date 2017-06-17 10:15:28 # Node ID 28a65fd4b3594200ccb4c4ae27d7fc797fe3f85b # Parent 6d983e8af49c391d464a0267395bf44267488e5a configitems: get default values from the central registry when available We do not have any registered config yet, but we are now ready to use them. For now we ignore this feature for config access with "alternates". On the long run, we expect alternates to be handled as "aliases" by the config item themself. diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -439,11 +439,17 @@ class ui(object): return self._data(untrusted).source(section, name) def config(self, section, name, default=_unset, untrusted=False): - if default is _unset: - default = None if isinstance(name, list): alternates = name + # let us ignore the config items in the alternates case for now + if default is _unset: + default = None else: + if default is _unset: + default = None + item = self._knownconfig.get(section, {}).get(name) + if item is not None: + default = item.default alternates = [name] for n in alternates: