--- a/tests/test-command-template.t Sun Nov 17 20:22:59 2013 -0500
+++ b/tests/test-command-template.t Tue Nov 19 11:29:56 2013 -0500
@@ -1601,3 +1601,23 @@
date: 70 01 01 02 +0000
date: 70 01 01 01 +0000
date: 70 01 01 00 +0000
+
+Test string escaping:
+
+ $ hg log -R latesttag -r 0 --template '>\n<>\\n<{if(rev, "[>\n<>\\n<]")}>\n<>\\n<\n'
+ >
+ <>\n<[>
+ <>\n<]>
+ <>\n<
+
+Test recursive evaluation:
+
+ $ hg init r
+ $ cd r
+ $ echo a > a
+ $ hg ci -Am '{rev}'
+ adding a
+ $ hg log -r 0 --template '{if(rev, desc)}\n'
+ {rev}
+ $ hg log -r 0 --template '{if(rev, "{author} {rev}")}\n'
+ test 0