revset: add tests of heads(commonancestors(..)) stable
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>
Tue, 25 Sep 2018 16:29:39 -0400
branchstable
changeset 39804 84c61c1593c4
parent 39803 0561e69ed9f1
child 39805 823f34acfd46
revset: add tests of heads(commonancestors(..)) The second-to-last one shows the same bug as commonancestors(..): the result should be 8, not 9. Differential Revision: https://phab.mercurial-scm.org/D4741
tests/test-revset.t
--- a/tests/test-revset.t	Tue Sep 25 16:18:43 2018 -0400
+++ b/tests/test-revset.t	Tue Sep 25 16:29:39 2018 -0400
@@ -1070,11 +1070,24 @@
   4
   8
 
+test the specialized implementation of heads(commonancestors(..))
+(2 gcas is tested in test-merge-criss-cross.t)
+
+  $ hg log -T '{rev}\n' -r 'heads(commonancestors(7 + 9))'
+  4
+  $ hg log -T '{rev}\n' -r 'heads(commonancestors(heads(all())))'
+  4
+  $ hg log -T '{rev}\n' -r 'heads(commonancestors(9))'
+  9
+  $ hg log -T '{rev}\n' -r 'heads(commonancestors(8 + 9))'
+  9
+
 test ancestor variants of empty revision
 
   $ log 'ancestor(none())'
   $ log 'ancestors(none())'
   $ log 'commonancestors(none())'
+  $ log 'heads(commonancestors(none()))'
 
 test ancestors with depth limit