diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -34,7 +34,7 @@ from . import ( elements = { # token-type: binding-strength, primary, prefix, infix, suffix "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), - "%": (16, None, None, ("%", 16), None), + "%": (15, None, None, ("%", 15), None), "|": (15, None, None, ("|", 15), None), "*": (5, None, None, ("*", 5), None), "/": (5, None, None, ("/", 5), None), diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -134,6 +134,20 @@ But negate binds closer still: (string '\n')) -3 +Filters bind as close as map operator: + + $ hg debugtemplate -r0 -v '{desc|splitlines % "{line}\n"}' + (template + (% + (| + (symbol 'desc') + (symbol 'splitlines')) + (template + (symbol 'line') + (string '\n')))) + line 1 + line 2 + Keyword arguments: $ hg debugtemplate -r0 -v '{foo=bar|baz}'