mercurial/templateutil.py
changeset 37073 44757e6dad93
parent 37070 1101d6747d2d
child 37074 2891079fb0c0
equal deleted inserted replaced
37072:d64ae4fef471 37073:44757e6dad93
   347         except TemplateNotFound:
   347         except TemplateNotFound:
   348             v = default
   348             v = default
   349     if callable(v) and getattr(v, '_requires', None) is None:
   349     if callable(v) and getattr(v, '_requires', None) is None:
   350         # old templatekw: expand all keywords and resources
   350         # old templatekw: expand all keywords and resources
   351         # (TODO: deprecate this after porting web template keywords to new API)
   351         # (TODO: deprecate this after porting web template keywords to new API)
   352         props = {k: f(context, mapping, k)
   352         props = {k: context._resources.lookup(context, mapping, k)
   353                  for k, f in context._resources.items()}
   353                  for k in context._resources.knownkeys()}
   354         # pass context to _showcompatlist() through templatekw._showlist()
   354         # pass context to _showcompatlist() through templatekw._showlist()
   355         props['templ'] = context
   355         props['templ'] = context
   356         props.update(mapping)
   356         props.update(mapping)
   357         return v(**pycompat.strkwargs(props))
   357         return v(**pycompat.strkwargs(props))
   358     if callable(v):
   358     if callable(v):