# HG changeset patch # User Benoit Boissinot # Date 2009-11-16 10:55:29 # Node ID ea38a2c1bdd3cbdf4c98b7e52f47c1c269fca1b6 # Parent 24bc6e414610d0e5cffb8eeff2991af29c60ea56 lock: the correct way to do a trylock() is to use a timeout of 0 diff --git a/mercurial/lock.py b/mercurial/lock.py --- a/mercurial/lock.py +++ b/mercurial/lock.py @@ -112,8 +112,7 @@ class lock(object): # if locker dead, break lock. must do this with another lock # held, or can race and break valid lock. try: - l = lock(self.f + '.break') - l.trylock() + l = lock(self.f + '.break', timeout=0) os.unlink(self.f) l.release() except error.LockError: