revset: fix commonancestor test so it demonstrates correct behavior stable
authorValentin Gatien-Baron <vgatien-baron@janestreet.com>
Tue, 25 Sep 2018 16:03:14 -0400
branchstable
changeset 39799 f28812c708a5
parent 39547 41ac8ea1bdd7
child 39800 572cd30eaffb
revset: fix commonancestor test so it demonstrates correct behavior The problem is that hg log -r 'head()' is every changeset in the repository, because in this test repository, every changeset has a different branch. The author probably assumed all commits were on the default branch, and that they were getting topological heads, 7 and 9. As a result, this test was showing that the common ancestors of 0:9 are 0+1+2+4, which is not correct (next commit will test this). Differential Revision: https://phab.mercurial-scm.org/D4736
tests/test-revset.t
--- a/tests/test-revset.t	Tue Sep 11 13:52:17 2018 -0400
+++ b/tests/test-revset.t	Tue Sep 25 16:03:14 2018 -0400
@@ -1049,7 +1049,7 @@
   2
   4
 
-  $ hg log -T '{rev}\n' -r 'commonancestors(head())'
+  $ hg log -T '{rev}\n' -r 'commonancestors(heads(all()))'
   0
   1
   2