hidden: move computation in filter function
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 08 Jan 2013 14:10:29 +0100
changeset 18248 378a025ff269
parent 18247 da9e544c69d6
child 18249 e3504d7ff760
hidden: move computation in filter function There is not good reason for this computation to be handle in a different way from the other. We are moving the computation of hidden revs in the filter function. In later changesets, code that access to `repo.hiddenrevs` will be updated and the property dropped.
mercurial/localrepo.py
mercurial/repoview.py
--- a/mercurial/localrepo.py	Tue Jan 08 12:41:51 2013 +0100
+++ b/mercurial/localrepo.py	Tue Jan 08 14:10:29 2013 +0100
@@ -364,12 +364,7 @@
 
         hidden changesets cannot have non-hidden descendants
         """
-        hidden = set()
-        if self.obsstore:
-            ### hide extinct changeset that are not accessible by any mean
-            hiddenquery = 'extinct() - ::(. + bookmark())'
-            hidden.update(self.revs(hiddenquery))
-        return hidden
+        return repoview.filteredrevs(self, 'hidden')
 
     @storecache('00changelog.i')
     def changelog(self):
--- a/mercurial/repoview.py	Tue Jan 08 12:41:51 2013 +0100
+++ b/mercurial/repoview.py	Tue Jan 08 14:10:29 2013 +0100
@@ -17,7 +17,9 @@
     During most operation hidden should be filtered."""
     assert not repo.changelog.filteredrevs
     if repo.obsstore:
-        return frozenset(repo.revs('hidden()'))
+        ### hide extinct changeset that are not accessible by any mean
+        hiddenquery = 'extinct() - ::(. + bookmark())'
+        return frozenset(repo.revs(hiddenquery))
     return frozenset()
 
 def computeunserved(repo):