Show More
@@ -1,385 +1,385 b'' | |||
|
1 | 1 | |
|
2 | 2 | $ cat << EOF > buggylocking.py |
|
3 | 3 | > """A small extension that tests our developer warnings |
|
4 | 4 | > """ |
|
5 | 5 | > |
|
6 | 6 | > from mercurial import error, registrar, repair, util |
|
7 | 7 | > |
|
8 | 8 | > cmdtable = {} |
|
9 | 9 | > command = registrar.command(cmdtable) |
|
10 | 10 | > |
|
11 | 11 | > @command(b'buggylocking', [], '') |
|
12 | 12 | > def buggylocking(ui, repo): |
|
13 | 13 | > lo = repo.lock() |
|
14 | 14 | > wl = repo.wlock() |
|
15 | 15 | > wl.release() |
|
16 | 16 | > lo.release() |
|
17 | 17 | > |
|
18 | 18 | > @command(b'buggytransaction', [], '') |
|
19 | 19 | > def buggylocking(ui, repo): |
|
20 | > tr = repo.transaction('buggy') | |
|
20 | > tr = repo.transaction(b'buggy') | |
|
21 | 21 | > # make sure we rollback the transaction as we don't want to rely on the__del__ |
|
22 | 22 | > tr.release() |
|
23 | 23 | > |
|
24 | 24 | > @command(b'properlocking', [], '') |
|
25 | 25 | > def properlocking(ui, repo): |
|
26 | 26 | > """check that reentrance is fine""" |
|
27 | 27 | > wl = repo.wlock() |
|
28 | 28 | > lo = repo.lock() |
|
29 | > tr = repo.transaction('proper') | |
|
30 | > tr2 = repo.transaction('proper') | |
|
29 | > tr = repo.transaction(b'proper') | |
|
30 | > tr2 = repo.transaction(b'proper') | |
|
31 | 31 | > lo2 = repo.lock() |
|
32 | 32 | > wl2 = repo.wlock() |
|
33 | 33 | > wl2.release() |
|
34 | 34 | > lo2.release() |
|
35 | 35 | > tr2.close() |
|
36 | 36 | > tr.close() |
|
37 | 37 | > lo.release() |
|
38 | 38 | > wl.release() |
|
39 | 39 | > |
|
40 | 40 | > @command(b'nowaitlocking', [], '') |
|
41 | 41 | > def nowaitlocking(ui, repo): |
|
42 | 42 | > lo = repo.lock() |
|
43 | 43 | > wl = repo.wlock(wait=False) |
|
44 | 44 | > wl.release() |
|
45 | 45 | > lo.release() |
|
46 | 46 | > |
|
47 | 47 | > @command(b'no-wlock-write', [], '') |
|
48 | 48 | > def nowlockwrite(ui, repo): |
|
49 | > with repo.vfs(b'branch', 'a'): | |
|
49 | > with repo.vfs(b'branch', b'a'): | |
|
50 | 50 | > pass |
|
51 | 51 | > |
|
52 | 52 | > @command(b'no-lock-write', [], '') |
|
53 | 53 | > def nolockwrite(ui, repo): |
|
54 | > with repo.svfs(b'fncache', 'a'): | |
|
54 | > with repo.svfs(b'fncache', b'a'): | |
|
55 | 55 | > pass |
|
56 | 56 | > |
|
57 | 57 | > @command(b'stripintr', [], '') |
|
58 | 58 | > def stripintr(ui, repo): |
|
59 | 59 | > lo = repo.lock() |
|
60 | > tr = repo.transaction('foobar') | |
|
60 | > tr = repo.transaction(b'foobar') | |
|
61 | 61 | > try: |
|
62 | > repair.strip(repo.ui, repo, [repo['.'].node()]) | |
|
62 | > repair.strip(repo.ui, repo, [repo[b'.'].node()]) | |
|
63 | 63 | > finally: |
|
64 | 64 | > lo.release() |
|
65 | 65 | > @command(b'oldanddeprecated', [], '') |
|
66 | 66 | > def oldanddeprecated(ui, repo): |
|
67 | 67 | > """test deprecation warning API""" |
|
68 | 68 | > def foobar(ui): |
|
69 | > ui.deprecwarn('foorbar is deprecated, go shopping', '42.1337') | |
|
69 | > ui.deprecwarn(b'foorbar is deprecated, go shopping', b'42.1337') | |
|
70 | 70 | > foobar(ui) |
|
71 | 71 | > @command(b'nouiwarning', [], '') |
|
72 | 72 | > def nouiwarning(ui, repo): |
|
73 | > util.nouideprecwarn('this is a test', '13.37') | |
|
73 | > util.nouideprecwarn(b'this is a test', b'13.37') | |
|
74 | 74 | > @command(b'programmingerror', [], '') |
|
75 | 75 | > def programmingerror(ui, repo): |
|
76 | > raise error.ProgrammingError('something went wrong', hint='try again') | |
|
76 | > raise error.ProgrammingError(b'something went wrong', hint=b'try again') | |
|
77 | 77 | > EOF |
|
78 | 78 | |
|
79 | 79 | $ cat << EOF >> $HGRCPATH |
|
80 | 80 | > [extensions] |
|
81 | 81 | > buggylocking=$TESTTMP/buggylocking.py |
|
82 | 82 | > mock=$TESTDIR/mockblackbox.py |
|
83 | 83 | > blackbox= |
|
84 | 84 | > [devel] |
|
85 | 85 | > all-warnings=1 |
|
86 | 86 | > EOF |
|
87 | 87 | |
|
88 | 88 | $ hg init lock-checker |
|
89 | 89 | $ cd lock-checker |
|
90 | 90 | $ hg buggylocking |
|
91 | 91 | devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob) |
|
92 | 92 | $ cat << EOF >> $HGRCPATH |
|
93 | 93 | > [devel] |
|
94 | 94 | > all=0 |
|
95 | 95 | > check-locks=1 |
|
96 | 96 | > EOF |
|
97 | 97 | $ hg buggylocking |
|
98 | 98 | devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob) |
|
99 | 99 | #if no-chg |
|
100 | 100 | $ hg buggylocking --traceback |
|
101 | 101 | devel-warn: "wlock" acquired after "lock" at: |
|
102 | 102 | */hg:* in <module> (glob) (?) |
|
103 | 103 | */mercurial/dispatch.py:* in run (glob) |
|
104 | 104 | */mercurial/dispatch.py:* in dispatch (glob) |
|
105 | 105 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
106 | 106 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
107 | 107 | */mercurial/scmutil.py* in callcatch (glob) |
|
108 | 108 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
109 | 109 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
110 | 110 | */mercurial/dispatch.py:* in runcommand (glob) |
|
111 | 111 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
112 | 112 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
113 | 113 | */mercurial/util.py:* in check (glob) |
|
114 | 114 | $TESTTMP/buggylocking.py:* in buggylocking (glob) |
|
115 | 115 | #else |
|
116 | 116 | $ hg buggylocking --traceback |
|
117 | 117 | devel-warn: "wlock" acquired after "lock" at: |
|
118 | 118 | */hg:* in <module> (glob) (?) |
|
119 | 119 | */mercurial/dispatch.py:* in run (glob) |
|
120 | 120 | */mercurial/dispatch.py:* in dispatch (glob) |
|
121 | 121 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
122 | 122 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
123 | 123 | */mercurial/scmutil.py:* in callcatch (glob) |
|
124 | 124 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
125 | 125 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
126 | 126 | */mercurial/dispatch.py:* in runcommand (glob) |
|
127 | 127 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
128 | 128 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
129 | 129 | */mercurial/util.py:* in check (glob) |
|
130 | 130 | */mercurial/commands.py:* in serve (glob) |
|
131 | 131 | */mercurial/server.py:* in runservice (glob) |
|
132 | 132 | */mercurial/commandserver.py:* in run (glob) |
|
133 | 133 | */mercurial/commandserver.py:* in _mainloop (glob) |
|
134 | 134 | */mercurial/commandserver.py:* in _runworker (glob) |
|
135 | 135 | */mercurial/commandserver.py:* in _serverequest (glob) |
|
136 | 136 | */mercurial/commandserver.py:* in serve (glob) |
|
137 | 137 | */mercurial/commandserver.py:* in serveone (glob) |
|
138 | 138 | */mercurial/chgserver.py:* in runcommand (glob) |
|
139 | 139 | */mercurial/commandserver.py:* in runcommand (glob) |
|
140 | 140 | */mercurial/dispatch.py:* in dispatch (glob) |
|
141 | 141 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
142 | 142 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
143 | 143 | */mercurial/scmutil.py:* in callcatch (glob) |
|
144 | 144 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
145 | 145 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
146 | 146 | */mercurial/dispatch.py:* in runcommand (glob) |
|
147 | 147 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
148 | 148 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
149 | 149 | */mercurial/util.py:* in check (glob) |
|
150 | 150 | $TESTTMP/buggylocking.py:* in buggylocking (glob) |
|
151 | 151 | #endif |
|
152 | 152 | $ hg properlocking |
|
153 | 153 | $ hg nowaitlocking |
|
154 | 154 | |
|
155 | 155 | Writing without lock |
|
156 | 156 | |
|
157 | 157 | $ hg no-wlock-write |
|
158 | 158 | devel-warn: write with no wlock: "branch" at: $TESTTMP/buggylocking.py:* (nowlockwrite) (glob) |
|
159 | 159 | |
|
160 | 160 | $ hg no-lock-write |
|
161 | 161 | devel-warn: write with no lock: "fncache" at: $TESTTMP/buggylocking.py:* (nolockwrite) (glob) |
|
162 | 162 | |
|
163 | 163 | Stripping from a transaction |
|
164 | 164 | |
|
165 | 165 | $ echo a > a |
|
166 | 166 | $ hg add a |
|
167 | 167 | $ hg commit -m a |
|
168 | 168 | $ hg stripintr 2>&1 | egrep -v '^(\*\*| )' |
|
169 | 169 | Traceback (most recent call last): |
|
170 | 170 | *ProgrammingError: cannot strip from inside a transaction (glob) |
|
171 | 171 | |
|
172 | 172 | $ hg oldanddeprecated |
|
173 | 173 | devel-warn: foorbar is deprecated, go shopping |
|
174 | 174 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob) |
|
175 | 175 | |
|
176 | 176 | #if no-chg |
|
177 | 177 | $ hg oldanddeprecated --traceback |
|
178 | 178 | devel-warn: foorbar is deprecated, go shopping |
|
179 | 179 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: |
|
180 | 180 | */hg:* in <module> (glob) (?) |
|
181 | 181 | */mercurial/dispatch.py:* in run (glob) |
|
182 | 182 | */mercurial/dispatch.py:* in dispatch (glob) |
|
183 | 183 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
184 | 184 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
185 | 185 | */mercurial/scmutil.py* in callcatch (glob) |
|
186 | 186 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
187 | 187 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
188 | 188 | */mercurial/dispatch.py:* in runcommand (glob) |
|
189 | 189 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
190 | 190 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
191 | 191 | */mercurial/util.py:* in check (glob) |
|
192 | 192 | $TESTTMP/buggylocking.py:* in oldanddeprecated (glob) |
|
193 | 193 | #else |
|
194 | 194 | $ hg oldanddeprecated --traceback |
|
195 | 195 | devel-warn: foorbar is deprecated, go shopping |
|
196 | 196 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: |
|
197 | 197 | */hg:* in <module> (glob) |
|
198 | 198 | */mercurial/dispatch.py:* in run (glob) |
|
199 | 199 | */mercurial/dispatch.py:* in dispatch (glob) |
|
200 | 200 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
201 | 201 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
202 | 202 | */mercurial/scmutil.py:* in callcatch (glob) |
|
203 | 203 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
204 | 204 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
205 | 205 | */mercurial/dispatch.py:* in runcommand (glob) |
|
206 | 206 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
207 | 207 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
208 | 208 | */mercurial/util.py:* in check (glob) |
|
209 | 209 | */mercurial/commands.py:* in serve (glob) |
|
210 | 210 | */mercurial/server.py:* in runservice (glob) |
|
211 | 211 | */mercurial/commandserver.py:* in run (glob) |
|
212 | 212 | */mercurial/commandserver.py:* in _mainloop (glob) |
|
213 | 213 | */mercurial/commandserver.py:* in _runworker (glob) |
|
214 | 214 | */mercurial/commandserver.py:* in _serverequest (glob) |
|
215 | 215 | */mercurial/commandserver.py:* in serve (glob) |
|
216 | 216 | */mercurial/commandserver.py:* in serveone (glob) |
|
217 | 217 | */mercurial/chgserver.py:* in runcommand (glob) |
|
218 | 218 | */mercurial/commandserver.py:* in runcommand (glob) |
|
219 | 219 | */mercurial/dispatch.py:* in dispatch (glob) |
|
220 | 220 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
221 | 221 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
222 | 222 | */mercurial/scmutil.py:* in callcatch (glob) |
|
223 | 223 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
224 | 224 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
225 | 225 | */mercurial/dispatch.py:* in runcommand (glob) |
|
226 | 226 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
227 | 227 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
228 | 228 | */mercurial/util.py:* in check (glob) |
|
229 | 229 | $TESTTMP/buggylocking.py:* in oldanddeprecated (glob) |
|
230 | 230 | #endif |
|
231 | 231 | |
|
232 | 232 | #if no-chg |
|
233 | 233 | $ hg blackbox -l 7 |
|
234 | 234 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated |
|
235 | 235 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping |
|
236 | 236 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob) |
|
237 | 237 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob) |
|
238 | 238 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback |
|
239 | 239 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping |
|
240 | 240 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: |
|
241 | 241 | */hg:* in <module> (glob) (?) |
|
242 | 242 | */mercurial/dispatch.py:* in run (glob) |
|
243 | 243 | */mercurial/dispatch.py:* in dispatch (glob) |
|
244 | 244 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
245 | 245 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
246 | 246 | */mercurial/scmutil.py* in callcatch (glob) |
|
247 | 247 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
248 | 248 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
249 | 249 | */mercurial/dispatch.py:* in runcommand (glob) |
|
250 | 250 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
251 | 251 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
252 | 252 | */mercurial/util.py:* in check (glob) |
|
253 | 253 | $TESTTMP/buggylocking.py:* in oldanddeprecated (glob) |
|
254 | 254 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob) |
|
255 | 255 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7 |
|
256 | 256 | #else |
|
257 | 257 | $ hg blackbox -l 7 |
|
258 | 258 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated |
|
259 | 259 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping |
|
260 | 260 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob) |
|
261 | 261 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob) |
|
262 | 262 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback |
|
263 | 263 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping |
|
264 | 264 | (compatibility will be dropped after Mercurial-42.1337, update your code.) at: |
|
265 | 265 | */hg:* in <module> (glob) |
|
266 | 266 | */mercurial/dispatch.py:* in run (glob) |
|
267 | 267 | */mercurial/dispatch.py:* in dispatch (glob) |
|
268 | 268 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
269 | 269 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
270 | 270 | */mercurial/scmutil.py:* in callcatch (glob) |
|
271 | 271 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
272 | 272 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
273 | 273 | */mercurial/dispatch.py:* in runcommand (glob) |
|
274 | 274 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
275 | 275 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
276 | 276 | */mercurial/util.py:* in check (glob) |
|
277 | 277 | */mercurial/commands.py:* in serve (glob) |
|
278 | 278 | */mercurial/server.py:* in runservice (glob) |
|
279 | 279 | */mercurial/commandserver.py:* in run (glob) |
|
280 | 280 | */mercurial/commandserver.py:* in _mainloop (glob) |
|
281 | 281 | */mercurial/commandserver.py:* in _runworker (glob) |
|
282 | 282 | */mercurial/commandserver.py:* in _serverequest (glob) |
|
283 | 283 | */mercurial/commandserver.py:* in serve (glob) |
|
284 | 284 | */mercurial/commandserver.py:* in serveone (glob) |
|
285 | 285 | */mercurial/chgserver.py:* in runcommand (glob) |
|
286 | 286 | */mercurial/commandserver.py:* in runcommand (glob) |
|
287 | 287 | */mercurial/dispatch.py:* in dispatch (glob) |
|
288 | 288 | */mercurial/dispatch.py:* in _runcatch (glob) |
|
289 | 289 | */mercurial/dispatch.py:* in _callcatch (glob) |
|
290 | 290 | */mercurial/scmutil.py:* in callcatch (glob) |
|
291 | 291 | */mercurial/dispatch.py:* in _runcatchfunc (glob) |
|
292 | 292 | */mercurial/dispatch.py:* in _dispatch (glob) |
|
293 | 293 | */mercurial/dispatch.py:* in runcommand (glob) |
|
294 | 294 | */mercurial/dispatch.py:* in _runcommand (glob) |
|
295 | 295 | */mercurial/dispatch.py:* in <lambda> (glob) |
|
296 | 296 | */mercurial/util.py:* in check (glob) |
|
297 | 297 | $TESTTMP/buggylocking.py:* in oldanddeprecated (glob) |
|
298 | 298 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob) |
|
299 | 299 | 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7 |
|
300 | 300 | #endif |
|
301 | 301 | |
|
302 | 302 | Test programming error failure: |
|
303 | 303 | |
|
304 | 304 | $ hg buggytransaction 2>&1 | egrep -v '^ ' |
|
305 | 305 | ** Unknown exception encountered with possibly-broken third-party extension buggylocking |
|
306 | 306 | ** which supports versions unknown of Mercurial. |
|
307 | 307 | ** Please disable buggylocking and try your action again. |
|
308 | 308 | ** If that fixes the bug please report it to the extension author. |
|
309 | 309 | ** Python * (glob) |
|
310 | 310 | ** Mercurial Distributed SCM (*) (glob) |
|
311 | 311 | ** Extensions loaded: * (glob) |
|
312 | 312 | ** ProgrammingError: transaction requires locking |
|
313 | 313 | Traceback (most recent call last): |
|
314 | 314 | *ProgrammingError: transaction requires locking (glob) |
|
315 | 315 | |
|
316 | 316 | $ hg programmingerror 2>&1 | egrep -v '^ ' |
|
317 | 317 | ** Unknown exception encountered with possibly-broken third-party extension buggylocking |
|
318 | 318 | ** which supports versions unknown of Mercurial. |
|
319 | 319 | ** Please disable buggylocking and try your action again. |
|
320 | 320 | ** If that fixes the bug please report it to the extension author. |
|
321 | 321 | ** Python * (glob) |
|
322 | 322 | ** Mercurial Distributed SCM (*) (glob) |
|
323 | 323 | ** Extensions loaded: * (glob) |
|
324 | 324 | ** ProgrammingError: something went wrong |
|
325 | 325 | ** (try again) |
|
326 | 326 | Traceback (most recent call last): |
|
327 | 327 | *ProgrammingError: something went wrong (glob) |
|
328 | 328 | |
|
329 | 329 | Old style deprecation warning |
|
330 | 330 | |
|
331 | 331 | $ hg nouiwarning |
|
332 | 332 | $TESTTMP/buggylocking.py:*: DeprecationWarning: this is a test (glob) |
|
333 | 333 | (compatibility will be dropped after Mercurial-13.37, update your code.) |
|
334 | util.nouideprecwarn('this is a test', '13.37') | |
|
334 | util.nouideprecwarn(b'this is a test', b'13.37') | |
|
335 | 335 | |
|
336 | 336 | (disabled outside of test run) |
|
337 | 337 | |
|
338 | 338 | $ HGEMITWARNINGS= hg nouiwarning |
|
339 | 339 | |
|
340 | 340 | Test warning on config option access and registration |
|
341 | 341 | |
|
342 | 342 | $ cat << EOF > ${TESTTMP}/buggyconfig.py |
|
343 | 343 | > """A small extension that tests our developer warnings for config""" |
|
344 | 344 | > |
|
345 | 345 | > from mercurial import registrar, configitems |
|
346 | 346 | > |
|
347 | 347 | > cmdtable = {} |
|
348 | 348 | > command = registrar.command(cmdtable) |
|
349 | 349 | > |
|
350 | 350 | > configtable = {} |
|
351 | 351 | > configitem = registrar.configitem(configtable) |
|
352 | 352 | > |
|
353 | > configitem('test', 'some', default='foo') | |
|
354 | > configitem('test', 'dynamic', default=configitems.dynamicdefault) | |
|
355 | > configitem('test', 'callable', default=list) | |
|
353 | > configitem(b'test', b'some', default=b'foo') | |
|
354 | > configitem(b'test', b'dynamic', default=configitems.dynamicdefault) | |
|
355 | > configitem(b'test', b'callable', default=list) | |
|
356 | 356 | > # overwrite a core config |
|
357 | > configitem('ui', 'quiet', default=False) | |
|
358 | > configitem('ui', 'interactive', default=None) | |
|
357 | > configitem(b'ui', b'quiet', default=False) | |
|
358 | > configitem(b'ui', b'interactive', default=None) | |
|
359 | 359 | > |
|
360 | 360 | > @command(b'buggyconfig') |
|
361 | 361 | > def cmdbuggyconfig(ui, repo): |
|
362 | > repo.ui.config('ui', 'quiet', True) | |
|
363 | > repo.ui.config('ui', 'interactive', False) | |
|
364 | > repo.ui.config('test', 'some', 'bar') | |
|
365 | > repo.ui.config('test', 'some', 'foo') | |
|
366 | > repo.ui.config('test', 'dynamic', 'some-required-default') | |
|
367 | > repo.ui.config('test', 'dynamic') | |
|
368 | > repo.ui.config('test', 'callable', []) | |
|
369 | > repo.ui.config('test', 'callable', 'foo') | |
|
370 | > repo.ui.config('test', 'unregistered') | |
|
371 | > repo.ui.config('unregistered', 'unregistered') | |
|
362 | > repo.ui.config(b'ui', b'quiet', True) | |
|
363 | > repo.ui.config(b'ui', b'interactive', False) | |
|
364 | > repo.ui.config(b'test', b'some', b'bar') | |
|
365 | > repo.ui.config(b'test', b'some', b'foo') | |
|
366 | > repo.ui.config(b'test', b'dynamic', b'some-required-default') | |
|
367 | > repo.ui.config(b'test', b'dynamic') | |
|
368 | > repo.ui.config(b'test', b'callable', []) | |
|
369 | > repo.ui.config(b'test', b'callable', b'foo') | |
|
370 | > repo.ui.config(b'test', b'unregistered') | |
|
371 | > repo.ui.config(b'unregistered', b'unregistered') | |
|
372 | 372 | > EOF |
|
373 | 373 | |
|
374 | 374 | $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig |
|
375 | 375 | devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: */mercurial/extensions.py:* (_loadextra) (glob) |
|
376 | 376 | devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: */mercurial/extensions.py:* (_loadextra) (glob) |
|
377 | 377 | devel-warn: specifying a mismatched default value for a registered config item: 'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
378 | 378 | devel-warn: specifying a mismatched default value for a registered config item: 'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
379 | 379 | devel-warn: specifying a mismatched default value for a registered config item: 'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
380 | 380 | devel-warn: config item requires an explicit default value: 'test.dynamic' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
381 | 381 | devel-warn: specifying a mismatched default value for a registered config item: 'test.callable' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
382 | 382 | devel-warn: accessing unregistered config item: 'test.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
383 | 383 | devel-warn: accessing unregistered config item: 'unregistered.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob) |
|
384 | 384 | |
|
385 | 385 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now