[PATCH 2 of 6 V2-Series-A] hidden: drop cache on hiddenrevs property

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Tue Jan 8 07:28:50 CST 2013


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1357651009 -3600
# Node ID 585d2fbfbc2c5eb39b1c31193763fd581c41fef0
# Parent  5d632321c8459be3760505ab596b54d6ad0267d1
hidden: drop cache on hiddenrevs property

The `filteredrevs` function already have a cache mechanism. And this cache in
invalidated at the same time than the current property cache. So we drop the
cache on the property.

The property itself is going to be dropped soon.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -348,11 +348,12 @@ class localrepository(object):
             # message is rare enough to not be translated
             msg = 'obsolete feature not enabled but %i markers found!\n'
             self.ui.warn(msg % len(list(store)))
         return store
 
-    @unfilteredpropertycache
+    @property
+    @unfiltered
     def hiddenrevs(self):
         """hiddenrevs: revs that should be hidden by command and tools
 
         This set is carried on the repo to ease initialization and lazy
         loading; it'll probably move back to changelog for efficiency and
@@ -959,12 +960,10 @@ class localrepository(object):
         self.invalidatevolatilesets()
 
     def invalidatevolatilesets(self):
         self.filteredrevcache.clear()
         obsolete.clearobscaches(self)
-        if 'hiddenrevs' in vars(self):
-            del self.hiddenrevs
 
     def invalidatedirstate(self):
         '''Invalidates the dirstate, causing the next call to dirstate
         to check if it was modified since the last time it was read,
         rereading it if it has.


More information about the Mercurial-devel mailing list