##// END OF EJS Templates
templater: update error message of invalid number passed to word() function...
Yuya Nishihara -
r25003:5e584edb default
parent child Browse files
Show More
@@ -569,8 +569,7 def word(context, mapping, args):
569 num = int(stringify(args[0][0](context, mapping, args[0][1])))
569 num = int(stringify(args[0][0](context, mapping, args[0][1])))
570 except ValueError:
570 except ValueError:
571 # i18n: "word" is a keyword
571 # i18n: "word" is a keyword
572 raise error.ParseError(
572 raise error.ParseError(_("word expects an integer index"))
573 _("Use strings like '3' for numbers passed to word function"))
574 text = stringify(args[1][0](context, mapping, args[1][1]))
573 text = stringify(args[1][0](context, mapping, args[1][1]))
575 if len(args) == 3:
574 if len(args) == 3:
576 splitter = stringify(args[2][0](context, mapping, args[2][1]))
575 splitter = stringify(args[2][0](context, mapping, args[2][1]))
@@ -2778,5 +2778,5 Test word for integer literal
2778 Test word for invalid numbers
2778 Test word for invalid numbers
2779
2779
2780 $ hg log -Gv -R a --template "{word('a', desc)}"
2780 $ hg log -Gv -R a --template "{word('a', desc)}"
2781 hg: parse error: Use strings like '3' for numbers passed to word function
2781 hg: parse error: word expects an integer index
2782 [255]
2782 [255]
General Comments 0
You need to be logged in to leave comments. Login now