[PATCH 07 of 14 clfilter part 1 V2] clfilter: ensure cache invalidation is done on the main unfiltered repo

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Nov 26 12:34:40 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1353954132 -3600
# Node ID bb15b9ca1bdd2461f361f08e055c0fa1493df6f7
# Parent  d59e5140f90d40baedeb784face8c8e1761de1d0
clfilter: ensure cache invalidation is done on the main unfiltered repo

The proxy version will not hold any cache for now. But we have to ensure all
cache operation are done on the unfiltered version.

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1073,20 +1073,21 @@ class localrepository(object):
             for k in self.dirstate._filecache:
                 try:
                     delattr(self.dirstate, k)
                 except AttributeError:
                     pass
-            delattr(self, 'dirstate')
+            delattr(self.unfiltered(), 'dirstate')
 
     def invalidate(self):
+        unfiltered = self.unfiltered() # all filecache are store on unfiltered
         for k in self._filecache:
             # dirstate is invalidated separately in invalidatedirstate()
             if k == 'dirstate':
                 continue
 
             try:
-                delattr(self, k)
+                delattr(unfiltered, k)
             except AttributeError:
                 pass
         self.invalidatecaches()
 
     def _lock(self, lockname, wait, releasefn, acquirefn, desc):
@@ -1487,10 +1488,11 @@ class localrepository(object):
         finally:
             if tr:
                 tr.release()
             lock.release()
 
+    @unfilteredmeth
     def destroyed(self, newheadnodes=None):
         '''Inform the repository that nodes have been destroyed.
         Intended for use by strip and rollback, so there's a common
         place for anything that has to be done after destroying history.
 


More information about the Mercurial-devel mailing list