hidden: use both parents of working directory
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 08 Jan 2013 17:31:00 +0100
changeset 18250 f54898526aad
parent 18249 e3504d7ff760
child 18251 a6483f827512
hidden: use both parents of working directory If we are merging with and extinct revision, this extinct revision should not be hidden.
mercurial/repoview.py
tests/test-log.t
--- a/mercurial/repoview.py	Tue Jan 08 14:16:49 2013 +0100
+++ b/mercurial/repoview.py	Tue Jan 08 17:31:00 2013 +0100
@@ -18,7 +18,7 @@
     assert not repo.changelog.filteredrevs
     if repo.obsstore:
         ### hide extinct changeset that are not accessible by any mean
-        hiddenquery = 'extinct() - ::(. + bookmark())'
+        hiddenquery = 'extinct() - ::(parents() + bookmark())'
         return frozenset(repo.revs(hiddenquery))
     return frozenset()
 
--- a/tests/test-log.t	Tue Jan 08 14:16:49 2013 +0100
+++ b/tests/test-log.t	Tue Jan 08 17:31:00 2013 +0100
@@ -1162,6 +1162,20 @@
   1:a765632148dc55d38c35c4f247c618701886cb2f
   0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
 
+test that parent prevent a changeset to be hidden
+
+  $ hg up 1 -q
+  $ hg log --template='{rev}:{node}\n'
+  1:a765632148dc55d38c35c4f247c618701886cb2f
+  0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
+
+test that second parent prevent a changeset to be hidden too
+
+  $ hg debugsetparents 0 1 # nothing suitable to merge here
+  $ hg log --template='{rev}:{node}\n'
+  1:a765632148dc55d38c35c4f247c618701886cb2f
+  0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
+
 clear extensions configuration
   $ echo '[extensions]' >> $HGRCPATH
   $ echo "obs=!" >> $HGRCPATH