localrepo: move filecache clearing into invalidate
authorMatt Mackall <mpm@selenic.com>
Fri, 01 Jun 2012 23:44:10 -0500
changeset 16830 357e6bcfb619
parent 16829 6403fdd716fe
child 16833 7b460b49bf7b
localrepo: move filecache clearing into invalidate Moving from self.destroy to _rollback fixed rollback fixed rollback but broke mq. Move it lower rather than sideways.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Fri Jun 01 23:42:27 2012 -0500
+++ b/mercurial/localrepo.py	Fri Jun 01 23:44:10 2012 -0500
@@ -838,9 +838,6 @@
                         self.sjoin('phaseroots'))
         self.invalidate()
 
-        # Discard all cache entries to force reloading everything.
-        self._filecache.clear()
-
         parentgone = (parents[0] not in self.changelog.nodemap or
                       parents[1] not in self.changelog.nodemap)
         if parentgone:
@@ -905,6 +902,9 @@
                 pass
         self.invalidatecaches()
 
+        # Discard all cache entries to force reloading everything.
+        self._filecache.clear()
+
     def _lock(self, lockname, wait, releasefn, acquirefn, desc):
         try:
             l = lock.lock(lockname, 0, releasefn, desc=desc)