Mercurial > public > mercurial-scm > hg
diff tests/test-command-template.t @ 19330:867b9957d895
templater: add strip function with chars as an extra argument
This allows specifying characters to strip, like the Python strip function.
author | Alexander Plavin <me@aplavin.ru> |
---|---|
date | Tue, 25 Jun 2013 21:02:22 +0400 |
parents | d982edcfe7f0 |
children | 0361163efbaf |
line wrap: on
line diff
--- a/tests/test-command-template.t Mon Jun 24 14:02:01 2013 -0400 +++ b/tests/test-command-template.t Tue Jun 25 21:02:22 2013 +0400 @@ -1536,3 +1536,31 @@ $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n' xx + +Test the strip function with chars specified: + + $ hg log -R latesttag --template '{desc}\n' + at3 + t5 + t3 + t2 + t1 + merge + h2e + h2d + h1c + b + a + + $ hg log -R latesttag --template '{strip(desc, "te")}\n' + at3 + 5 + 3 + 2 + 1 + merg + h2 + h2d + h1c + b + a