template: allow unquoted int function arguments

This commit is contained in:
Brendan Cully 2013-04-07 23:25:50 -07:00
parent 5659e9d1ac
commit 1c111a8da8
2 changed files with 10 additions and 1 deletions

View File

@ -66,6 +66,9 @@ def tokenizer(data):
break break
pos += 1 pos += 1
sym = program[s:pos] sym = program[s:pos]
try:
yield('string', str(int(sym)), s)
except ValueError:
yield ('symbol', sym, s) yield ('symbol', sym, s)
pos -= 1 pos -= 1
elif c == '}': elif c == '}':

View File

@ -1360,6 +1360,12 @@ Age filter:
$ hg log -l1 --template '{date|age}\n' $ hg log -l1 --template '{date|age}\n'
7 years from now 7 years from now
Filter with int function argument:
$ hg log --template '{fill(author, 20)}\n' -r 0
User Name
<user@hostname>
Error on syntax: Error on syntax:
$ echo 'x = "f' >> t $ echo 'x = "f' >> t