Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templateutil.py @ 37279:9e8128e84326
templater: pass (context, mapping) down to unwrapvalue()
The same reason as why I made unwraphybrid() take a (context, mapping) pair.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 18 Mar 2018 23:14:21 +0900 |
parents | b4630e332a99 |
children | 671a01cd50b5 |
line wrap: on
line diff
--- a/mercurial/templateutil.py Sat Mar 17 20:58:28 2018 +0900 +++ b/mercurial/templateutil.py Sun Mar 18 23:14:21 2018 +0900 @@ -157,7 +157,7 @@ return thing return thing.show(context, mapping) -def unwrapvalue(thing): +def unwrapvalue(context, mapping, thing): """Move the inner value object out of the wrapper""" if not util.safehasattr(thing, '_value'): return thing @@ -327,7 +327,7 @@ # is fixed. we can't do that right now because join() has to take a generator # of byte strings as it is, not a lazy byte string. def _unwrapvalue(context, mapping, thing): - thing = unwrapvalue(thing) + thing = unwrapvalue(context, mapping, thing) # evalrawexp() may return string, generator of strings or arbitrary object # such as date tuple, but filter does not want generator. if isinstance(thing, types.GeneratorType): @@ -344,7 +344,7 @@ thing = stringutil.parsebool(data) else: thing = func(context, mapping, data) - thing = unwrapvalue(thing) + thing = unwrapvalue(context, mapping, thing) if isinstance(thing, bool): return thing # other objects are evaluated as strings, which means 0 is True, but