Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
24749:3ad1571d4852 | 24750:aaf835407bf2 |
---|---|
1210 l = self._wlockref and self._wlockref() | 1210 l = self._wlockref and self._wlockref() |
1211 if l is not None and l.held: | 1211 if l is not None and l.held: |
1212 l.lock() | 1212 l.lock() |
1213 return l | 1213 return l |
1214 | 1214 |
1215 if (self.ui.configbool('devel', 'all') | 1215 # We do not need to check for non-waiting lock aquisition. Such |
1216 or self.ui.configbool('devel', 'check-locks')): | 1216 # acquisition would not cause dead-lock as they would just fail. |
1217 if wait and (self.ui.configbool('devel', 'all') | |
1218 or self.ui.configbool('devel', 'check-locks')): | |
1217 l = self._lockref and self._lockref() | 1219 l = self._lockref and self._lockref() |
1218 if l is not None and l.held: | 1220 if l is not None and l.held: |
1219 scmutil.develwarn(self.ui, '"wlock" acquired after "lock"') | 1221 scmutil.develwarn(self.ui, '"wlock" acquired after "lock"') |
1220 | 1222 |
1221 def unlock(): | 1223 def unlock(): |