From patchwork Sun Sep 24 12:21:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2,of,8] templater: do not destructure operands in buildmap() From: Yuya Nishihara X-Patchwork-Id: 24128 Message-Id: <596b89fea274b424ff0d.1506255711@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sun, 24 Sep 2017 21:21:51 +0900 # HG changeset patch # User Yuya Nishihara # Date 1504361374 -32400 # Sat Sep 02 23:09:34 2017 +0900 # Node ID 596b89fea274b424ff0da758817632e95bc0b64c # Parent 3ffcbeb430fd598e253c8ee8b70cfc23978f7c09 templater: do not destructure operands in buildmap() This makes the next patch slightly simpler. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -410,12 +410,12 @@ def runfilter(context, mapping, data): raise error.Abort(msg) def buildmap(exp, context): - func, data = compileexp(exp[1], context, methods) - tfunc, tdata = gettemplate(exp[2], context) - return (runmap, (func, data, tfunc, tdata)) + darg = compileexp(exp[1], context, methods) + targ = gettemplate(exp[2], context) + return (runmap, (darg, targ)) def runmap(context, mapping, data): - func, data, tfunc, tdata = data + (func, data), (tfunc, tdata) = data d = func(context, mapping, data) if util.safehasattr(d, 'itermaps'): diter = d.itermaps()