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,7 +66,10 @@ def tokenizer(data):
|
||||
break
|
||||
pos += 1
|
||||
sym = program[s:pos]
|
||||
yield ('symbol', sym, s)
|
||||
try:
|
||||
yield('string', str(int(sym)), s)
|
||||
except ValueError:
|
||||
yield ('symbol', sym, s)
|
||||
pos -= 1
|
||||
elif c == '}':
|
||||
pos += 1
|
||||
|
@ -1360,6 +1360,12 @@ Age filter:
|
||||
$ hg log -l1 --template '{date|age}\n'
|
||||
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:
|
||||
|
||||
$ echo 'x = "f' >> t
|
||||
|
Loading…
Reference in New Issue
Block a user