diff mercurial/templateutil.py @ 39582:28f974d83c0a

templater: remove unused context argument from most resourcemapper functions While working on demand loading of ctx/fctx objects, I noticed that it's quite easy to create infinite recursion by carelessly using the template context in the resource mapper. Let's make that not happen.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 07 Jun 2018 23:27:54 +0900
parents 5b1d406b39f1
children 8fa26f3baf30
line wrap: on
line diff
--- a/mercurial/templateutil.py	Mon Sep 10 20:57:18 2018 +0900
+++ b/mercurial/templateutil.py	Thu Jun 07 23:27:54 2018 +0900
@@ -856,7 +856,7 @@
         # old templatekw: expand all keywords and resources
         # (TODO: drop support for old-style functions. 'f._requires = ()'
         #  can be removed.)
-        props = {k: context._resources.lookup(context, mapping, k)
+        props = {k: context._resources.lookup(mapping, k)
                  for k in context._resources.knownkeys()}
         # pass context to _showcompatlist() through templatekw._showlist()
         props['templ'] = context