[PATCH 7 of 7 V4] hidden: invalidate hiddenrevs when needed

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Thu Dec 20 10:23:46 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1355791868 -3600
# Node ID 41d7e99714ac389d6d71daa60aad220f77aa5108
# Parent  f14f34849f9411ba55e7ac0dd953050f09e1f77a
hidden: invalidate hiddenrevs when needed

The `hiddenrevs` cache is volatile too (It use content from `obscache`). When
unsure it is invalidated when necessary. In a near future, the cache will
probably be moved to `revsfiltercache`

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1104,10 +1104,12 @@ 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