Comments
Patch
@@ -221,9 +221,10 @@ def evalfuncarg(context, mapping, arg):
return thing
def evalinteger(context, mapping, arg, err):
+ v = evalfuncarg(context, mapping, arg)
try:
- return int(stringify(arg[0](context, mapping, arg[1])))
- except ValueError:
+ return int(v)
+ except (TypeError, ValueError):
raise error.ParseError(err)
def runinteger(context, mapping, data):
@@ -3148,6 +3148,9 @@ Test recursive evaluation:
text.1:be wrapped
text.1:desc to be
text.1:wrapped (no-eol)
+ $ hg log -l1 -T '{fill(desc, date, "", "")}\n'
+ hg: parse error: fill expects an integer width
+ [255]
$ hg log -l 1 --template '{sub(r"[0-9]", "-", author)}'
{node|short} (no-eol)