comparison tests/test-devel-warnings.t @ 24744:bedefc611f25

wlock: only issue devel warning when actually acquiring the lock Before this change, any call to 'wlock' after we acquired a 'lock' was issuing a warning. This is wrong as the 'wlock' have been properly acquired before the 'lock' in a previous call. We move the warning code to only issue such warnings when we are acquiring the 'wlock' -after- acquiring 'lock'. This is the expected behavior of this warning from the start.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 12 Apr 2015 10:01:48 -0400
parents 1b97cc5d2272
children bc34b286781f
comparison
equal deleted inserted replaced
24743:a2ef1dc3b59b 24744:bedefc611f25
13 > tr = repo.transaction('buggy') 13 > tr = repo.transaction('buggy')
14 > lo = repo.lock() 14 > lo = repo.lock()
15 > wl = repo.wlock() 15 > wl = repo.wlock()
16 > wl.release() 16 > wl.release()
17 > lo.release() 17 > lo.release()
18 >
19 > @command('properlocking', [], '')
20 > def properlocking(ui, repo):
21 > """check that reentrance is fine"""
22 > wl = repo.wlock()
23 > lo = repo.lock()
24 > tr = repo.transaction('proper')
25 > tr2 = repo.transaction('proper')
26 > lo2 = repo.lock()
27 > wl2 = repo.wlock()
28 > wl2.release()
29 > lo2.release()
30 > tr2.close()
31 > tr.close()
32 > lo.release()
33 > wl.release()
18 > EOF 34 > EOF
19 35
20 $ cat << EOF >> $HGRCPATH 36 $ cat << EOF >> $HGRCPATH
21 > [extensions] 37 > [extensions]
22 > buggylocking=$TESTTMP/buggylocking.py 38 > buggylocking=$TESTTMP/buggylocking.py
62 */mercurial/dispatch.py:* in _runcommand (glob) 78 */mercurial/dispatch.py:* in _runcommand (glob)
63 */mercurial/dispatch.py:* in checkargs (glob) 79 */mercurial/dispatch.py:* in checkargs (glob)
64 */mercurial/dispatch.py:* in <lambda> (glob) 80 */mercurial/dispatch.py:* in <lambda> (glob)
65 */mercurial/util.py:* in check (glob) 81 */mercurial/util.py:* in check (glob)
66 $TESTTMP/buggylocking.py:* in buggylocking (glob) 82 $TESTTMP/buggylocking.py:* in buggylocking (glob)
83 $ hg properlocking
67 $ cd .. 84 $ cd ..