# HG changeset patch # User Pierre-Yves David # Date 2021-01-29 13:03:39 # Node ID 5272542196cc6d7ee05f33fe5abd9c006a964650 # Parent 271dfcb98544fd05cc7e85cc180dc0cd9e7790cb config: use the right API to access template access Preventing direct access to the underlying dict will help a coming refactoring of `config`. Differential Revision: https://phab.mercurial-scm.org/D9922 diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -891,7 +891,7 @@ def _readmapfile(fp, mapfile): fp = _open_mapfile(path) cache, tmap, aliases = _readmapfile(fp, path) - for key, val in conf[b'templates'].items(): + for key, val in conf.items(b'templates'): if not val: raise error.ParseError( _(b'missing value'), conf.source(b'templates', key) @@ -904,7 +904,7 @@ def _readmapfile(fp, mapfile): cache[key] = unquotestring(val) elif key != b'__base__': tmap[key] = os.path.join(base, val) - aliases.extend(conf[b'templatealias'].items()) + aliases.extend(conf.items(b'templatealias')) return cache, tmap, aliases