Mercurial > public > mercurial-scm > hg-stable
diff hgext/fastannotate/context.py @ 42951:0152a907f714
fastannotate: remove support for flock() locking
We've seen enough weirdness in CI with flock for remotefilelog that
I'm now of the opinion we should just stop using flock() everywhere
until someone has a concrete need for the extra performance *and* a
way to only use it when safe (even if that's just default-to-off.)
Differential Revision: https://phab.mercurial-scm.org/D6861
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 17 Sep 2019 14:22:22 -0400 |
parents | 1198c86beb73 |
children | 2372284d9457 |
line wrap: on
line diff
--- a/hgext/fastannotate/context.py Tue Sep 17 14:20:13 2019 -0400 +++ b/hgext/fastannotate/context.py Tue Sep 17 14:22:22 2019 -0400 @@ -759,21 +759,6 @@ def lock(self): return lockmod.lock(self._repo.vfs, self._vfspath + '.lock') - @contextlib.contextmanager - def _lockflock(self): - """the same as 'lock' but use flock instead of lockmod.lock, to avoid - creating temporary symlinks.""" - import fcntl - lockpath = self.linelogpath - util.makedirs(os.path.dirname(lockpath)) - lockfd = os.open(lockpath, os.O_RDONLY | os.O_CREAT, 0o664) - fcntl.flock(lockfd, fcntl.LOCK_EX) - try: - yield - finally: - fcntl.flock(lockfd, fcntl.LOCK_UN) - os.close(lockfd) - @property def revmappath(self): return self._repo.vfs.join(self._vfspath + '.m')