tests/test-command-template.t
changeset 20072 6d4fda48b4e3
parent 20008 e54a078153f7
parent 20067 3d8bfe2ecf6d
child 20077 986d09e696ff
--- 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