mercurial/localrepo.py
changeset 17208 8018f2340807
parent 17207 62c56c94c77e
child 17210 ec80ae982689
--- a/mercurial/localrepo.py	Mon Jul 16 17:44:46 2012 +0200
+++ b/mercurial/localrepo.py	Mon Jul 16 17:56:50 2012 +0200
@@ -131,12 +131,6 @@
         # Callback are in the form: func(repo, roots) --> processed root.
         # This list it to be filled by extension during repo setup
         self._phasedefaults = []
-        # hiddenrevs: revs that should be hidden by command and tools
-        #
-        # This set is carried on the repo to ease initialisation and lazy
-        # loading it'll probably move back to changelog for efficienty and
-        # consistency reason
-        self.hiddenrevs = set()
         try:
             self.ui.readconfig(self.join("hgrc"), self.root)
             extensions.loadall(self.ui)
@@ -297,6 +291,25 @@
         store = obsolete.obsstore(self.sopener)
         return store
 
+    @propertycache
+    def hiddenrevs(self):
+        """hiddenrevs: revs that should be hidden by command and tools
+
+        This set is carried on the repo to ease initialisation and lazy
+        loading it'll probably move back to changelog for efficienty and
+        consistency reason
+
+        Note that the hiddenrevs will needs invalidations when
+        - a new changesets is added (possible unstable above extinct)
+        - a new obsolete marker is added (possible new extinct changeset)
+        """
+        hidden = set()
+        if self.obsstore:
+            ### hide extinct changeset that are not accessible by any mean
+            hiddenquery = 'extinct() - ::(. + bookmark() + tagged())'
+            hidden.update(self.revs(hiddenquery))
+        return hidden
+
     @storecache('00changelog.i')
     def changelog(self):
         c = changelog.changelog(self.sopener)