mercurial/templateutil.py
changeset 50610 ae2de4cb7869
parent 50609 f013e790d8bf
child 50617 26e63204c31e
equal deleted inserted replaced
50609:f013e790d8bf 50610:ae2de4cb7869
   339         return bool(self._values)
   339         return bool(self._values)
   340 
   340 
   341     def tovalue(self, context, mapping):
   341     def tovalue(self, context, mapping):
   342         # TODO: make it non-recursive for trivial lists/dicts
   342         # TODO: make it non-recursive for trivial lists/dicts
   343         xs = self._values
   343         xs = self._values
   344         if util.safehasattr(xs, b'get'):
   344         if util.safehasattr(xs, 'get'):
   345             return {k: unwrapvalue(context, mapping, v) for k, v in xs.items()}
   345             return {k: unwrapvalue(context, mapping, v) for k, v in xs.items()}
   346         return [unwrapvalue(context, mapping, x) for x in xs]
   346         return [unwrapvalue(context, mapping, x) for x in xs]
   347 
   347 
   348 
   348 
   349 class hybriditem(mappable, wrapped):
   349 class hybriditem(mappable, wrapped):