# HG changeset patch # User Yuya Nishihara # Date 2018-03-20 16:18:29 # Node ID c2456a7726c1c9661147f20f15178d8cec0a6751 # Parent ead71b15efd500143fc73d2114a1ad10a4095bd3 templater: do dict lookup over a wrapped object Dict/list lookup operations will be moved to a wrapped interface so that a returned element can inherit hybrid-ness automatically. wraphybridvalue() will be inlined. diff --git a/mercurial/templatefuncs.py b/mercurial/templatefuncs.py --- a/mercurial/templatefuncs.py +++ b/mercurial/templatefuncs.py @@ -261,7 +261,7 @@ def get(context, mapping, args): # i18n: "get" is a keyword raise error.ParseError(_("get() expects two arguments")) - dictarg = evalfuncarg(context, mapping, args[0]) + dictarg = evalwrapped(context, mapping, args[0]) if not util.safehasattr(dictarg, 'get'): # i18n: "get" is a keyword raise error.ParseError(_("get() expects a dict as first argument")) diff --git a/mercurial/templateutil.py b/mercurial/templateutil.py --- a/mercurial/templateutil.py +++ b/mercurial/templateutil.py @@ -662,7 +662,7 @@ def runmap(context, mapping, data): def runmember(context, mapping, data): darg, memb = data - d = evalrawexp(context, mapping, darg) + d = evalwrapped(context, mapping, darg) if util.safehasattr(d, 'tomap'): lm = context.overlaymap(mapping, d.tomap()) return runsymbol(context, lm, memb)