diff mercurial/localrepo.py @ 20380:c697b70f295f

localrepo: give a sigh of relief when getting lock after waiting for it A message like this was sometimes shown when pushing: remote: waiting for lock on repository foo held by 'mercurial:20858' That could scare users, making them wonder whether the push actually succeeded. To mitigate that fear, issue an additional "warning" such as: got lock after 2 seconds The return value from lock.lock.lock() was unused - instead we return the delay. This also adds the first test coverage for waiting for locks.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 06 Feb 2014 01:55:09 +0100
parents a6cf48b2880d
children d4f804caa0ed
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Jan 22 15:43:21 2014 -0600
+++ b/mercurial/localrepo.py	Thu Feb 06 01:55:09 2014 +0100
@@ -1005,6 +1005,7 @@
             l = lockmod.lock(vfs, lockname,
                              int(self.ui.config("ui", "timeout", "600")),
                              releasefn, desc=desc)
+            self.ui.warn(_("got lock after %s seconds\n") % l.delay)
         if acquirefn:
             acquirefn()
         return l