tests/test-command-template.t
branchstable
changeset 27939 7ed3a3c0cef1
parent 27894 a94f7eef3199
child 27940 cfe7da66f555
--- a/tests/test-command-template.t	Fri Jan 22 16:31:50 2016 -0800
+++ b/tests/test-command-template.t	Wed Jul 22 23:29:41 2015 +0900
@@ -1035,6 +1035,33 @@
   1
   0
 
+Check that recursive reference does not fall into RuntimeError (issue4758):
+
+ common mistake:
+
+  $ hg log -T '{changeset}\n'
+  abort: recursive reference 'changeset' in template
+  [255]
+
+ circular reference:
+
+  $ cat << EOF > issue4758
+  > changeset = '{foo}'
+  > foo = '{changeset}'
+  > EOF
+  $ hg log --style ./issue4758
+  abort: recursive reference 'foo' in template
+  [255]
+
+ not a recursion if a keyword of the same name exists:
+
+  $ cat << EOF > issue4758
+  > changeset = '{tags % rev}'
+  > rev = '{rev} {tag}\n'
+  > EOF
+  $ hg log --style ./issue4758 -r tip
+  8 tip
+
 Check that {phase} works correctly on parents:
 
   $ cat << EOF > parentphase