diff mercurial/localrepo.py @ 20627:a42ea6d209e6

localrepo: add hook point to invalidate everything on each command-server run MQ extension will wrap this function to invalidate its state. repo.invalidate cannot be wrapped for this purpose because qpush obtains repo.lock in the middle of the operation, triggering repo.invalidate. Also, it seems wrong to obtain lock earlier because mq data is non-store parts.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 03 Mar 2014 19:41:23 +0900
parents de8eb208b7d0
children a4d587c6e3dd
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Mar 01 20:08:41 2014 -0600
+++ b/mercurial/localrepo.py	Mon Mar 03 19:41:23 2014 +0900
@@ -993,6 +993,13 @@
                 pass
         self.invalidatecaches()
 
+    def invalidateall(self):
+        '''Fully invalidates both store and non-store parts, causing the
+        subsequent operation to reread any outside changes.'''
+        # extension should hook this to invalidate its caches
+        self.invalidate()
+        self.invalidatedirstate()
+
     def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc):
         try:
             l = lockmod.lock(vfs, lockname, 0, releasefn, desc=desc)