##// END OF EJS Templates
templatefilters: fix crash by string formatting of '{x|splitlines}'...
Yuya Nishihara -
r32039:2ab7578e default
parent child Browse files
Show More
@@ -339,7 +339,7 b' def shortdate(text):'
339 @templatefilter('splitlines')
339 @templatefilter('splitlines')
340 def splitlines(text):
340 def splitlines(text):
341 """Any text. Split text into a list of lines."""
341 """Any text. Split text into a list of lines."""
342 return templatekw.showlist('line', text.splitlines(), {}, plural='lines')
342 return templatekw.hybridlist(text.splitlines(), name='line')
343
343
344 @templatefilter('stringescape')
344 @templatefilter('stringescape')
345 def stringescape(text):
345 def stringescape(text):
@@ -3894,6 +3894,11 b' Test splitlines'
3894 o foo line 1
3894 o foo line 1
3895 foo line 2
3895 foo line 2
3896
3896
3897 $ hg log -R a -r0 -T '{desc|splitlines}\n'
3898 line 1 line 2
3899 $ hg log -R a -r0 -T '{join(desc|splitlines, "|")}\n'
3900 line 1|line 2
3901
3897 Test startswith
3902 Test startswith
3898 $ hg log -Gv -R a --template "{startswith(desc)}"
3903 $ hg log -Gv -R a --template "{startswith(desc)}"
3899 hg: parse error: startswith expects two arguments
3904 hg: parse error: startswith expects two arguments
General Comments 0
You need to be logged in to leave comments. Login now