tests/test-wireproto.py.out
author Yuya Nishihara <yuya@tcha.org>
Tue, 24 Feb 2015 00:04:55 +0900
changeset 24280 6c55e37ba5f2
parent 14765 08ef6b5f3715
child 25708 d3d32643c060
permissions -rw-r--r--
templater: allow piping generator-type function output to filters Template functions use "yield"s assuming that the result will be combined into a string, which means both "f -> str" and "f -> generator" should behave in the same way. Before this patch, piping generator function resulted in a cryptic error. We had to insert "|stringify" in this case. $ hg log --template '{if(author, author)|user}\n' abort: template filter 'userfilter' is not compatible with keyword '[(<function runsymbol at 0x7f5af2e8d8c0>, 'author'), (<function runsymbol at 0x7f5af2e8d8c0>, 'author')]'

Hello, Foobar
['Hello, Fo, =;o', 'Hello, Bar']