comparison mercurial/templater.py @ 34332:86d050abd5c1

templater: do not destructure operands in buildmap() This makes the next patch slightly simpler.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 02 Sep 2017 23:09:34 +0900
parents e473f482b9b3
children e60c601953d7
comparison
equal deleted inserted replaced
34331:e473f482b9b3 34332:86d050abd5c1
408 else: 408 else:
409 msg = _("incompatible use of template filter '%s'") % filt.func_name 409 msg = _("incompatible use of template filter '%s'") % filt.func_name
410 raise error.Abort(msg) 410 raise error.Abort(msg)
411 411
412 def buildmap(exp, context): 412 def buildmap(exp, context):
413 func, data = compileexp(exp[1], context, methods) 413 darg = compileexp(exp[1], context, methods)
414 tfunc, tdata = gettemplate(exp[2], context) 414 targ = gettemplate(exp[2], context)
415 return (runmap, (func, data, tfunc, tdata)) 415 return (runmap, (darg, targ))
416 416
417 def runmap(context, mapping, data): 417 def runmap(context, mapping, data):
418 func, data, tfunc, tdata = data 418 (func, data), (tfunc, tdata) = data
419 d = func(context, mapping, data) 419 d = func(context, mapping, data)
420 if util.safehasattr(d, 'itermaps'): 420 if util.safehasattr(d, 'itermaps'):
421 diter = d.itermaps() 421 diter = d.itermaps()
422 else: 422 else:
423 try: 423 try: