Show More
@@ -1,118 +1,118 b'' | |||
|
1 | 1 | |
|
2 | 2 | $ cat << EOF > buggylocking.py |
|
3 |
> """A small extension that |
|
|
3 | > """A small extension that tests our developer warnings | |
|
4 | 4 | > """ |
|
5 | 5 | > |
|
6 | 6 | > from mercurial import cmdutil, repair, revset |
|
7 | 7 | > |
|
8 | 8 | > cmdtable = {} |
|
9 | 9 | > command = cmdutil.command(cmdtable) |
|
10 | 10 | > |
|
11 | 11 | > @command('buggylocking', [], '') |
|
12 | 12 | > def buggylocking(ui, repo): |
|
13 | 13 | > tr = repo.transaction('buggy') |
|
14 | 14 | > lo = repo.lock() |
|
15 | 15 | > wl = repo.wlock() |
|
16 | 16 | > wl.release() |
|
17 | 17 | > lo.release() |
|
18 | 18 | > |
|
19 | 19 | > @command('properlocking', [], '') |
|
20 | 20 | > def properlocking(ui, repo): |
|
21 | 21 | > """check that reentrance is fine""" |
|
22 | 22 | > wl = repo.wlock() |
|
23 | 23 | > lo = repo.lock() |
|
24 | 24 | > tr = repo.transaction('proper') |
|
25 | 25 | > tr2 = repo.transaction('proper') |
|
26 | 26 | > lo2 = repo.lock() |
|
27 | 27 | > wl2 = repo.wlock() |
|
28 | 28 | > wl2.release() |
|
29 | 29 | > lo2.release() |
|
30 | 30 | > tr2.close() |
|
31 | 31 | > tr.close() |
|
32 | 32 | > lo.release() |
|
33 | 33 | > wl.release() |
|
34 | 34 | > |
|
35 | 35 | > @command('nowaitlocking', [], '') |
|
36 | 36 | > def nowaitlocking(ui, repo): |
|
37 | 37 | > lo = repo.lock() |
|
38 | 38 | > wl = repo.wlock(wait=False) |
|
39 | 39 | > wl.release() |
|
40 | 40 | > lo.release() |
|
41 | 41 | > |
|
42 | 42 | > @command('stripintr', [], '') |
|
43 | 43 | > def stripintr(ui, repo): |
|
44 | 44 | > lo = repo.lock() |
|
45 | 45 | > tr = repo.transaction('foobar') |
|
46 | 46 | > try: |
|
47 | 47 | > repair.strip(repo.ui, repo, [repo['.'].node()]) |
|
48 | 48 | > finally: |
|
49 | 49 | > lo.release() |
|
50 | 50 | > |
|
51 | 51 | > def oldstylerevset(repo, subset, x): |
|
52 | 52 | > return list(subset) |
|
53 | 53 | > |
|
54 | 54 | > revset.symbols['oldstyle'] = oldstylerevset |
|
55 | 55 | > EOF |
|
56 | 56 | |
|
57 | 57 | $ cat << EOF >> $HGRCPATH |
|
58 | 58 | > [extensions] |
|
59 | 59 | > buggylocking=$TESTTMP/buggylocking.py |
|
60 | 60 | > [devel] |
|
61 | 61 | > all-warnings=1 |
|
62 | 62 | > EOF |
|
63 | 63 | |
|
64 | 64 | $ hg init lock-checker |
|
65 | 65 | $ cd lock-checker |
|
66 | 66 | $ hg buggylocking |
|
67 | 67 | devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:11 (buggylocking) |
|
68 | 68 | devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:13 (buggylocking) |
|
69 | 69 | $ cat << EOF >> $HGRCPATH |
|
70 | 70 | > [devel] |
|
71 | 71 | > all=0 |
|
72 | 72 | > check-locks=1 |
|
73 | 73 | > EOF |
|
74 | 74 | $ hg buggylocking |
|
75 | 75 | devel-warn: transaction with no lock at: $TESTTMP/buggylocking.py:11 (buggylocking) |
|
76 | 76 | devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:13 (buggylocking) |
|
77 | 77 | $ hg buggylocking --traceback |
|
78 | 78 | devel-warn: transaction with no lock at: |
|
79 | 79 | */hg:* in * (glob) |
|
80 | 80 | */mercurial/dispatch.py:* in run (glob) |
|
81 | 81 | */mercurial/dispatch.py:* in dispatch (glob) |
|
82 | 82 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
83 | 83 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
84 | 84 | */mercurial/dispatch.py:* in runcommand (glob) |
|
85 | 85 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
86 | 86 | */mercurial/dispatch.py:* in checkargs (glob) |
|
87 | 87 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
88 | 88 | */mercurial/util.py:* in check (glob) |
|
89 | 89 | $TESTTMP/buggylocking.py:* in buggylocking (glob) |
|
90 | 90 | devel-warn: "wlock" acquired after "lock" at: |
|
91 | 91 | */hg:* in * (glob) |
|
92 | 92 | */mercurial/dispatch.py:* in run (glob) |
|
93 | 93 | */mercurial/dispatch.py:* in dispatch (glob) |
|
94 | 94 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
95 | 95 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
96 | 96 | */mercurial/dispatch.py:* in runcommand (glob) |
|
97 | 97 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
98 | 98 | */mercurial/dispatch.py:* in checkargs (glob) |
|
99 | 99 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
100 | 100 | */mercurial/util.py:* in check (glob) |
|
101 | 101 | $TESTTMP/buggylocking.py:* in buggylocking (glob) |
|
102 | 102 | $ hg properlocking |
|
103 | 103 | $ hg nowaitlocking |
|
104 | 104 | |
|
105 | 105 | $ echo a > a |
|
106 | 106 | $ hg add a |
|
107 | 107 | $ hg commit -m a |
|
108 | 108 | $ hg stripintr |
|
109 | 109 | saved backup bundle to $TESTTMP/lock-checker/.hg/strip-backup/cb9a9f314b8b-cc5ccb0b-backup.hg (glob) |
|
110 | 110 | abort: programming error: cannot strip from inside a transaction |
|
111 | 111 | (contact your extension maintainer) |
|
112 | 112 | [255] |
|
113 | 113 | |
|
114 | 114 | $ hg log -r "oldstyle()" -T '{rev}\n' |
|
115 | 115 | devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: */mercurial/revset.py:* (mfunc) (glob) |
|
116 | 116 | 0 |
|
117 | 117 | |
|
118 | 118 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now