Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templateutil.py @ 37076:44757e6dad93
templater: introduce resourcemapper class
A couple more functions will be added later to work around nested mapping
bugs such as the issue 5612.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 15 Mar 2018 20:43:39 +0900 |
parents | 1101d6747d2d |
children | 2891079fb0c0 |
line wrap: on
line diff
--- a/mercurial/templateutil.py Thu Mar 15 20:27:38 2018 +0900 +++ b/mercurial/templateutil.py Thu Mar 15 20:43:39 2018 +0900 @@ -349,8 +349,8 @@ if callable(v) and getattr(v, '_requires', None) is None: # old templatekw: expand all keywords and resources # (TODO: deprecate this after porting web template keywords to new API) - props = {k: f(context, mapping, k) - for k, f in context._resources.items()} + props = {k: context._resources.lookup(context, mapping, k) + for k in context._resources.knownkeys()} # pass context to _showcompatlist() through templatekw._showlist() props['templ'] = context props.update(mapping)