diff tests/test-revset.t @ 38624:5460926352ee

revsets: add commonancestors revset This is a method to reproduce "::x and ::y" such that a set can be sent in. For instance, it'd be convenient to have "::heads()" work like this but that already means "::x + ::y + ..." for each element in the "heads()" set. Therefore, we add the "commonancestors" method to mean "::x and ::y ..." for each head in the given set.
author Sean Farley <sean@farley.io>
date Mon, 18 Jun 2018 19:41:54 -0700
parents 54d7aaa243cc
children e4b270a32ba8
line wrap: on
line diff
--- a/tests/test-revset.t	Mon Jul 09 10:07:20 2018 -0400
+++ b/tests/test-revset.t	Mon Jun 18 19:41:54 2018 -0700
@@ -1041,6 +1041,28 @@
   2
   3
 
+test common ancestors
+
+  $ hg log -T '{rev}\n' -r 'commonancestors(7 + 9)'
+  0
+  1
+  2
+  4
+
+  $ hg log -T '{rev}\n' -r 'commonancestors(head())'
+  0
+  1
+  2
+  4
+
+  $ hg log -T '{rev}\n' -r 'commonancestors(9)'
+  0
+  1
+  2
+  4
+  8
+  9
+
 test ancestors with depth limit
 
  (depth=0 selects the node itself)