Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 24750:aaf835407bf2
wlock: do not warn for non-wait locking
We are warning about lock acquired in the wrong order because this can create
dead-lock situation. But non-wait acquisition will not block and therefore not
create a dead-lock. So we do not need to wait in such case.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sun, 12 Apr 2015 15:37:59 -0400 |
parents | d6caadff4779 |
children | 59406b8b1303 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Sun Apr 12 14:27:42 2015 -0400 +++ b/mercurial/localrepo.py Sun Apr 12 15:37:59 2015 -0400 @@ -1212,8 +1212,10 @@ l.lock() return l - if (self.ui.configbool('devel', 'all') - or self.ui.configbool('devel', 'check-locks')): + # We do not need to check for non-waiting lock aquisition. Such + # acquisition would not cause dead-lock as they would just fail. + if wait and (self.ui.configbool('devel', 'all') + or self.ui.configbool('devel', 'check-locks')): l = self._lockref and self._lockref() if l is not None and l.held: scmutil.develwarn(self.ui, '"wlock" acquired after "lock"')