diff -r 9cf65f43b49b -r 662ea52d5dca tests/test-command-template.t --- a/tests/test-command-template.t Tue Sep 08 23:00:44 2015 +0900 +++ b/tests/test-command-template.t Mon Sep 07 21:58:17 2015 +0900 @@ -2731,6 +2731,13 @@ $ hg log -R latesttag -r 10 --template '{sub("[0-9]", "x", "{rev}")}\n' xx + $ hg log -R latesttag -r 10 -T '{sub("[", "x", rev)}\n' + hg: parse error: sub got an invalid pattern: [ + [255] + $ hg log -R latesttag -r 10 -T '{sub("[0-9]", r"\1", rev)}\n' + hg: parse error: sub got an invalid replacement: \1 + [255] + Test the strip function with chars specified: $ hg log -R latesttag --template '{desc}\n'