[PATCH 0 of 2] templater support for filter arguments

Brendan Cully brendan at kublai.com
Wed Nov 19 23:28:09 UTC 2008


Hi all,

The following patches add templater support for filter arguments. For
example, instead of writing {node|short} you could write
{node|shorten(12)}. I've included new filters "fill", "datefmt",
"head", and "shorten" as a demonstration. "datefmt" lets you write
{date|datefmt("%Y-%m-%d %H:%M")} instead of {date|isodate}, and head
lets you select the number of lines of text you want to keep, so
firstline is equivalent to head(1) as in {desc|head(1)}.

You can also put filters in front of % expandos for some interesting
new options. I've included a new hgpatch style demonstrating this
(perhaps in a silly way) -- it filters out revisions from the parents
list if they are less than 0.

This is post-1.1 stuff, but might be worth reviewing. It passes the
test suite.


More information about the Mercurial-devel mailing list