mercurial/lock.py
changeset 20380 c697b70f295f
parent 20091 abfe6a8e619b
child 23032 f484be02bd35
--- a/mercurial/lock.py	Wed Jan 22 15:43:21 2014 -0600
+++ b/mercurial/lock.py	Thu Feb 06 01:55:09 2014 +0100
@@ -38,7 +38,7 @@
         self.desc = desc
         self.postrelease  = []
         self.pid = os.getpid()
-        self.lock()
+        self.delay = self.lock()
 
     def __del__(self):
         if self.held:
@@ -57,7 +57,7 @@
         while True:
             try:
                 self.trylock()
-                return 1
+                return self.timeout - timeout
             except error.LockHeld, inst:
                 if timeout != 0:
                     time.sleep(1)