Mercurial > public > mercurial-scm > hg-stable
diff tests/test-command-template.t @ 28374:af3bd9d1dbc1
templater: move label() function from color extension
ui.label() is no-op by default, so we can just call ui.label() by label()
template function no matter if the color is enabled or not.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 11 Jun 2015 23:04:14 +0900 |
parents | 9a9dd71e882c |
children | 1987ed32efca |
line wrap: on
line diff
--- a/tests/test-command-template.t Thu Jun 11 22:58:27 2015 +0900 +++ b/tests/test-command-template.t Thu Jun 11 23:04:14 2015 +0900 @@ -3183,6 +3183,13 @@ $ hg log --color=always -l 1 --template '{label(red, "text\n")}' \x1b[0;31mtext\x1b[0m (esc) +label should be no-op if color is disabled: + + $ hg log --color=never -l 1 --template '{label(red, "text\n")}' + text + $ hg log --config extensions.color=! -l 1 --template '{label(red, "text\n")}' + text + Test branches inside if statement: $ hg log -r 0 --template '{if(branches, "yes", "no")}\n'