templater: use helper function to get name of non-iterable keyword
authorYuya Nishihara <yuya@tcha.org>
Sat, 09 Sep 2017 19:01:18 +0900
changeset 34324 e473f482b9b3
parent 34323 6c7aaf59b21e
child 34325 86d050abd5c1
templater: use helper function to get name of non-iterable keyword
mercurial/templater.py
--- a/mercurial/templater.py	Tue Sep 26 15:55:01 2017 +0200
+++ b/mercurial/templater.py	Sat Sep 09 19:01:18 2017 +0900
@@ -423,8 +423,9 @@
         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)