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