Mercurial > hg
diff tests/test-template-keywords.t @ 39587:918944f53aac
templatekw: add {size} keyword as an example of fctx-based keyword
I'll add {status}, and I think some lfs keywords can be migrated to this.
I'm not certain how many fctx-based keywords will be introduced into the
global space, but if there are a couple more, we'll probably need to sort
them out to the "File Keywords" section in the templater help. Until then,
fctx keywords are hidden as experimental.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 29 Jul 2018 21:28:51 +0900 |
parents | 5b1d406b39f1 |
children | 87428152e820 |
line wrap: on
line diff
--- a/tests/test-template-keywords.t Sun Jul 29 21:25:37 2018 +0900 +++ b/tests/test-template-keywords.t Sun Jul 29 21:28:51 2018 +0900 @@ -787,6 +787,15 @@ $ hg log -r8 -C -T '{file_copies_switch % "{path} <- {source}\n"}' fourth <- second +Test file attributes: + + $ hg log -l1 -T '{files % "{pad(size, 3, left=True)} {path}\n"}' + a + 0 b + 7 fifth + fourth + 13 third + Test index keyword: $ hg log -l 2 -T '{index + 10}{files % " {index}:{file}"}\n'