Patchwork [1,of,8] templater: use helper function to get name of non-iterable keyword

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 24, 2017, 12:21 p.m.
Message ID <3ffcbeb430fd598e253c.1506255710@mimosa>
Download mbox | patch
Permalink /patch/24127/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 24, 2017, 12:21 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1504951278 -32400
#      Sat Sep 09 19:01:18 2017 +0900
# Node ID 3ffcbeb430fd598e253c8ee8b70cfc23978f7c09
# Parent  575097b4dce054a5b8d992fe15797d9d62ceaf71
templater: use helper function to get name of non-iterable keyword

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -423,8 +423,9 @@  def runmap(context, mapping, data):
         try:
             diter = iter(d)
         except TypeError:
-            if func is runsymbol:
-                raise error.ParseError(_("keyword '%s' is not iterable") % data)
+            sym = findsymbolicname((func, data))
+            if sym:
+                raise error.ParseError(_("keyword '%s' is not iterable") % sym)
             else:
                 raise error.ParseError(_("%r is not iterable") % d)