##// END OF EJS Templates
templater: fix crash by empty group expression...
Yuya Nishihara -
r35762:8685192a default
parent child Browse files
Show More
@@ -259,6 +259,8 def prettyformat(tree):
259
259
260 def compileexp(exp, context, curmethods):
260 def compileexp(exp, context, curmethods):
261 """Compile parsed template tree to (func, data) pair"""
261 """Compile parsed template tree to (func, data) pair"""
262 if not exp:
263 raise error.ParseError(_("missing argument"))
262 t = exp[0]
264 t = exp[0]
263 if t in curmethods:
265 if t in curmethods:
264 return curmethods[t](exp, context)
266 return curmethods[t](exp, context)
@@ -2766,6 +2766,16 Error on syntax:
2766 hg: parse error at 6: invalid token
2766 hg: parse error at 6: invalid token
2767 [255]
2767 [255]
2768
2768
2769 $ hg log -T '{}'
2770 hg: parse error at 2: not a prefix: end
2771 [255]
2772 $ hg debugtemplate -v '{()}'
2773 (template
2774 (group
2775 None))
2776 hg: parse error: missing argument
2777 [255]
2778
2769 Behind the scenes, this will throw TypeError
2779 Behind the scenes, this will throw TypeError
2770
2780
2771 $ hg log -l 3 --template '{date|obfuscate}\n'
2781 $ hg log -l 3 --template '{date|obfuscate}\n'
General Comments 0
You need to be logged in to leave comments. Login now