templater: update error message of invalid number passed to word() function
authorYuya Nishihara <yuya@tcha.org>
Sat, 02 May 2015 15:49:38 +0900
changeset 25003 5e584edbb211
parent 25002 829faf8ab605
child 25004 e264d4c9629b
templater: update error message of invalid number passed to word() function "word(3, desc)" is valid now.
mercurial/templater.py
tests/test-command-template.t
--- a/mercurial/templater.py	Fri May 01 20:43:55 2015 +0900
+++ b/mercurial/templater.py	Sat May 02 15:49:38 2015 +0900
@@ -569,8 +569,7 @@
         num = int(stringify(args[0][0](context, mapping, args[0][1])))
     except ValueError:
         # i18n: "word" is a keyword
-        raise error.ParseError(
-                _("Use strings like '3' for numbers passed to word function"))
+        raise error.ParseError(_("word expects an integer index"))
     text = stringify(args[1][0](context, mapping, args[1][1]))
     if len(args) == 3:
         splitter = stringify(args[2][0](context, mapping, args[2][1]))
--- a/tests/test-command-template.t	Fri May 01 20:43:55 2015 +0900
+++ b/tests/test-command-template.t	Sat May 02 15:49:38 2015 +0900
@@ -2778,5 +2778,5 @@
 Test word for invalid numbers
 
   $ hg log -Gv -R a --template "{word('a', desc)}"
-  hg: parse error: Use strings like '3' for numbers passed to word function
+  hg: parse error: word expects an integer index
   [255]