mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
template: allow unquoted int function arguments
This commit is contained in:
parent
5659e9d1ac
commit
1c111a8da8
@ -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 == '}':
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user