changeset 46424:5272542196cc

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 29 Jan 2021 14:03:39 +0100
parents 271dfcb98544
children f7621fa14b84
files mercurial/templater.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templater.py	Fri Jan 29 14:03:01 2021 +0100
+++ b/mercurial/templater.py	Fri Jan 29 14:03:39 2021 +0100
@@ -891,7 +891,7 @@
         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 @@
             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