diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py --- a/mercurial/rcutil.py +++ b/mercurial/rcutil.py @@ -10,6 +10,7 @@ import os from . import ( + config, encoding, pycompat, util, @@ -90,10 +91,20 @@ continue _rccomponents.extend((b'path', p) for p in _expandrcpath(p)) else: + default_entries = [] + for path in defaultrcpath(): + cfg = config.config() + cfg.read(path) + for section in cfg: + for name, value in cfg.items(section): + source = cfg.source(section, name) + default_entries.append((section, name, value, source)) + _rccomponents = [(b'items', default_entries)] + normpaths = lambda paths: [ (b'path', os.path.normpath(p)) for p in paths ] - _rccomponents = normpaths(defaultrcpath() + systemrcpath()) + _rccomponents.extend(normpaths(systemrcpath())) _rccomponents.append(envrc) _rccomponents.extend(normpaths(userrcpath())) return _rccomponents