comparison 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
comparison
equal deleted inserted replaced
20625:7cbc6e228999 20627:a42ea6d209e6
990 try: 990 try:
991 delattr(unfiltered, k) 991 delattr(unfiltered, k)
992 except AttributeError: 992 except AttributeError:
993 pass 993 pass
994 self.invalidatecaches() 994 self.invalidatecaches()
995
996 def invalidateall(self):
997 '''Fully invalidates both store and non-store parts, causing the
998 subsequent operation to reread any outside changes.'''
999 # extension should hook this to invalidate its caches
1000 self.invalidate()
1001 self.invalidatedirstate()
995 1002
996 def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc): 1003 def _lock(self, vfs, lockname, wait, releasefn, acquirefn, desc):
997 try: 1004 try:
998 l = lockmod.lock(vfs, lockname, 0, releasefn, desc=desc) 1005 l = lockmod.lock(vfs, lockname, 0, releasefn, desc=desc)
999 except error.LockHeld, inst: 1006 except error.LockHeld, inst: