tests/test-command-template.t
changeset 28270 650c9f69a744
parent 28239 7279e0132347
child 28331 2874db5462d3
--- a/tests/test-command-template.t	Fri Feb 26 20:22:05 2016 +0900
+++ b/tests/test-command-template.t	Fri Feb 12 19:16:09 2016 +0900
@@ -3251,6 +3251,11 @@
   1 did not add a
   0 added a
 
+  $ hg log --debug -T '{rev}{ifcontains(1, parents, " is parent of 1")}\n'
+  2 is parent of 1
+  1
+  0
+
 Test revset function
 
   $ hg log --template '{rev} {ifcontains(rev, revset("."), "current rev", "not current rev")}\n'
@@ -3293,13 +3298,18 @@
   $ hg log --template '{revset("TIP"|lower)}\n' -l1
   2
 
- a list template is evaluated for each item of revset
+ a list template is evaluated for each item of revset/parents
 
   $ hg log -T '{rev} p: {revset("p1(%s)", rev) % "{rev}:{node|short}"}\n'
   2 p: 1:bcc7ff960b8e
   1 p: 0:f7769ec2ab97
   0 p: 
 
+  $ hg log --debug -T '{rev} p:{parents % " {rev}:{node|short}"}\n'
+  2 p: 1:bcc7ff960b8e -1:000000000000
+  1 p: 0:f7769ec2ab97 -1:000000000000
+  0 p: -1:000000000000 -1:000000000000
+
  therefore, 'revcache' should be recreated for each rev
 
   $ hg log -T '{rev} {file_adds}\np {revset("p1(%s)", rev) % "{file_adds}"}\n'
@@ -3310,6 +3320,14 @@
   0 a
   p 
 
+  $ hg log --debug -T '{rev} {file_adds}\np {parents % "{file_adds}"}\n'
+  2 aa b
+  p 
+  1 
+  p a
+  0 a
+  p 
+
 a revset item must be evaluated as an integer revision, not an offset from tip
 
   $ hg log -l 1 -T '{revset("null") % "{rev}:{node|short}"}\n'