##// END OF EJS Templates
wlock: do not warn for non-wait locking...
Pierre-Yves David -
r24750:aaf83540 default
parent child Browse files
Show More
@@ -1212,8 +1212,10 b' class localrepository(object):'
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"')
@@ -31,6 +31,13 b''
31 > tr.close()
31 > tr.close()
32 > lo.release()
32 > lo.release()
33 > wl.release()
33 > wl.release()
34 >
35 > @command('nowaitlocking', [], '')
36 > def nowaitlocking(ui, repo):
37 > lo = repo.lock()
38 > wl = repo.wlock(wait=False)
39 > wl.release()
40 > lo.release()
34 > EOF
41 > EOF
35
42
36 $ cat << EOF >> $HGRCPATH
43 $ cat << EOF >> $HGRCPATH
@@ -79,4 +86,5 b''
79 */mercurial/util.py:* in check (glob)
86 */mercurial/util.py:* in check (glob)
80 $TESTTMP/buggylocking.py:* in buggylocking (glob)
87 $TESTTMP/buggylocking.py:* in buggylocking (glob)
81 $ hg properlocking
88 $ hg properlocking
89 $ hg nowaitlocking
82 $ cd ..
90 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now