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

Yuya Nishihara yuya at tcha.org
Sun Sep 24 12:21:50 UTC 2017


# HG changeset patch
# User Yuya Nishihara <yuya at 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

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)
 


More information about the Mercurial-devel mailing list