# HG changeset patch # User Yuya Nishihara # Date 1393843283 -32400 # Node ID a42ea6d209e6ea777c9f0c2a8407ec943c0c6cb8 # Parent 7cbc6e228999958c837a9de0d3e423a409e8cf5e 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. diff -r 7cbc6e228999 -r a42ea6d209e6 mercurial/commandserver.py --- a/mercurial/commandserver.py Sat Mar 01 20:08:41 2014 -0600 +++ b/mercurial/commandserver.py Mon Mar 03 19:41:23 2014 +0900 @@ -188,8 +188,7 @@ repoui = self.repoui.__class__(self.repoui) repoui.copy = copiedui.copy # redo copy protection self.repo.ui = self.repo.dirstate._ui = repoui - self.repo.invalidate() - self.repo.invalidatedirstate() + self.repo.invalidateall() req = dispatch.request(args[:], copiedui, self.repo, self.cin, self.cout, self.cerr) diff -r 7cbc6e228999 -r a42ea6d209e6 mercurial/localrepo.py --- 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)