Mercurial > public > mercurial-scm > hg
diff mercurial/templateutil.py @ 42337:832c59d1196e
templater: drop support for old style keywords (API)
These changes originated from several commits over a period of time, so I'm
slightly unsure if this is correct. But the tests pass.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 18 May 2019 19:56:06 -0400 |
parents | 4591c9791a82 |
children | 2372284d9457 |
line wrap: on
line diff
--- a/mercurial/templateutil.py Sat May 18 19:38:47 2019 -0400 +++ b/mercurial/templateutil.py Sat May 18 19:56:06 2019 -0400 @@ -874,7 +874,6 @@ def _recursivesymbolblocker(key): def showrecursion(context, mapping): raise error.Abort(_("recursive reference '%s' in template") % key) - showrecursion._requires = () # mark as new-style templatekw return showrecursion def runsymbol(context, mapping, key, default=''): @@ -888,19 +887,6 @@ v = context.process(key, safemapping) except TemplateNotFound: v = default - if callable(v) and getattr(v, '_requires', None) is None: - # old templatekw: expand all keywords and resources - # (TODO: drop support for old-style functions. 'f._requires = ()' - # can be removed.) - props = {k: context._resources.lookup(mapping, k) - for k in context._resources.knownkeys()} - # pass context to _showcompatlist() through templatekw._showlist() - props['templ'] = context - props.update(mapping) - ui = props.get('ui') - if ui: - ui.deprecwarn("old-style template keyword '%s'" % key, '4.8') - return v(**pycompat.strkwargs(props)) if callable(v): # new templatekw try: