Mercurial > public > mercurial-scm > hg-stable
diff tests/test-command-template.t @ 31886:bdda942f4b9c
templater: add support for keyword arguments
Unlike revset, function arguments are pre-processed in templater. That's why
we need to define argspec per function. An argspec field looks somewhat
redundant in @templatefunc definition as a name field contains human-readable
list of arguments. I'll make function doc be built from argspec later.
Ported separate() function as an example.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 03 Apr 2017 21:22:39 +0900 |
parents | d18b624c1c06 |
children | f7b3677f66cd |
line wrap: on
line diff
--- a/tests/test-command-template.t Mon Apr 03 20:55:55 2017 +0900 +++ b/tests/test-command-template.t Mon Apr 03 21:22:39 2017 +0900 @@ -146,6 +146,13 @@ hg: parse error: can't use a key-value pair in this context [255] +Call function which takes named arguments by filter syntax: + + $ hg debugtemplate '{" "|separate}' + $ hg debugtemplate '{("not", "an", "argument", "list")|separate}' + hg: parse error: unknown method 'list' + [255] + Second branch starting at nullrev: $ hg update null