# HG changeset patch # User Siddharth Agarwal # Date 1443135806 25200 # Node ID c545d51c901ea8032cb2a4cc4e16f169b917a6ce # Parent de5a52e5eb9e3c6bb9992953a95e8979f96a3ca5 lock.release: do not unlink inherited locks This is part of a series that will allow locks to be inherited by subprocesses in limited circumstances. A subprocess unlinking a lock will lead to potential corruption from other concurrent processes. diff -r de5a52e5eb9e -r c545d51c901e mercurial/lock.py --- a/mercurial/lock.py Thu Sep 24 16:00:41 2015 -0700 +++ b/mercurial/lock.py Thu Sep 24 16:03:26 2015 -0700 @@ -204,10 +204,11 @@ if self.releasefn: self.releasefn() finally: - try: - self.vfs.unlink(self.f) - except OSError: - pass + if not self._parentheld: + try: + self.vfs.unlink(self.f) + except OSError: + pass for callback in self.postrelease: callback()