Patchwork [7,of,7,V4] hidden: invalidate hiddenrevs when needed

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 20, 2012, 4:23 p.m.
Message ID <41d7e99714ac389d6d71.1356020626@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/219/
State Accepted
Commit 2cf01eb74842954838b24384368db50425cb74c8
Headers show

Comments

Pierre-Yves David - Dec. 20, 2012, 4:23 p.m.
# 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`

Patch

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.