mercurial/lock.py
changeset 43749 039fbd14d4e2
parent 43748 cd822413b9aa
child 43798 888bd39ed555
--- a/mercurial/lock.py	Fri Nov 01 19:59:07 2019 -0400
+++ b/mercurial/lock.py	Mon Nov 18 20:10:38 2019 -0800
@@ -355,6 +355,9 @@
         # held, or can race and break valid lock.
         try:
             with lock(self.vfs, self.f + b'.break', timeout=0):
+                locker = self._readlock()
+                if not self._lockshouldbebroken(locker):
+                    return locker
                 self.vfs.unlink(self.f)
         except error.LockError:
             return locker