Mercurial > hg-stable
diff tests/test-command-template.t @ 27894:a94f7eef3199
templatekw: add {namespaces} keyword
This provides a general-purpose interface to all custom namespaces.
The {namespaces} keyword honors the definition order of namespaces as they
are kept by sortdict.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 12 Jan 2016 23:56:48 +0900 |
parents | baa77652be68 |
children | 7ed3a3c0cef1 |
line wrap: on
line diff
--- a/tests/test-command-template.t Tue Jan 12 23:53:56 2016 +0900 +++ b/tests/test-command-template.t Tue Jan 12 23:56:48 2016 +0900 @@ -3304,6 +3304,28 @@ 1 f 0 f +Test namespaces dict + + $ hg log -T '{rev}{namespaces % " {namespace}={join(names, ",")}"}\n' + 2 bookmarks=bar,foo tags=tip branches=text.{rev} + 1 bookmarks=baz tags= branches=text.{rev} + 0 bookmarks= tags= branches=default + $ hg log -r2 -T '{namespaces % "{namespace}: {names}\n"}' + bookmarks: bar foo + tags: tip + branches: text.{rev} + $ hg log -r2 -T '{namespaces % "{namespace}:\n{names % " {name}\n"}"}' + bookmarks: + bar + foo + tags: + tip + branches: + text.{rev} + $ hg log -r2 -T '{get(namespaces, "bookmarks") % "{name}\n"}' + bar + foo + Test stringify on sub expressions $ cd ..