##// END OF EJS Templates
pyoxidized: adapt test-devel-warnings.t...
marmoute -
r48641:d704aea4 stable
parent child Browse files
Show More
@@ -1,402 +1,470
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 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 29 > tr = repo.transaction(b'proper')
30 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 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 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 60 > tr = repo.transaction(b'foobar')
61 61 > try:
62 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 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 73 > util.nouideprecwarn(b'this is a test', b'13.37')
74 74 > @command(b'programmingerror', [], '')
75 75 > def programmingerror(ui, repo):
76 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 > [blackbox]
87 87 > track = command, commandexception, commandfinish, develwarn
88 88 > EOF
89 89
90 90 $ hg init lock-checker
91 91 $ cd lock-checker
92 92 $ hg buggylocking
93 93 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
94 94 $ cat << EOF >> $HGRCPATH
95 95 > [devel]
96 96 > all=0
97 97 > check-locks=1
98 98 > EOF
99 99 $ hg buggylocking
100 100 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
101 #if no-chg
101 #if no-chg no-pyoxidizer
102 102 $ hg buggylocking --traceback
103 103 devel-warn: "wlock" acquired after "lock" at:
104 104 */hg:* in <module> (glob) (?)
105 105 */mercurial/dispatch.py:* in run (glob)
106 106 */mercurial/dispatch.py:* in dispatch (glob)
107 107 */mercurial/dispatch.py:* in _rundispatch (glob)
108 108 */mercurial/dispatch.py:* in _runcatch (glob)
109 109 */mercurial/dispatch.py:* in _callcatch (glob)
110 110 */mercurial/scmutil.py* in callcatch (glob)
111 111 */mercurial/dispatch.py:* in _runcatchfunc (glob)
112 112 */mercurial/dispatch.py:* in _dispatch (glob)
113 113 */mercurial/dispatch.py:* in runcommand (glob)
114 114 */mercurial/dispatch.py:* in _runcommand (glob)
115 115 */mercurial/dispatch.py:* in <lambda> (glob)
116 116 */mercurial/util.py:* in check (glob)
117 117 $TESTTMP/buggylocking.py:* in buggylocking (glob)
118 #else
118 #endif
119 #if chg no-pyoxidizer
119 120 $ hg buggylocking --traceback
120 121 devel-warn: "wlock" acquired after "lock" at:
121 122 */hg:* in <module> (glob) (?)
122 123 */mercurial/dispatch.py:* in run (glob)
123 124 */mercurial/dispatch.py:* in dispatch (glob)
124 125 */mercurial/dispatch.py:* in _rundispatch (glob)
125 126 */mercurial/dispatch.py:* in _runcatch (glob)
126 127 */mercurial/dispatch.py:* in _callcatch (glob)
127 128 */mercurial/scmutil.py:* in callcatch (glob)
128 129 */mercurial/dispatch.py:* in _runcatchfunc (glob)
129 130 */mercurial/dispatch.py:* in _dispatch (glob)
130 131 */mercurial/dispatch.py:* in runcommand (glob)
131 132 */mercurial/dispatch.py:* in _runcommand (glob)
132 133 */mercurial/dispatch.py:* in <lambda> (glob)
133 134 */mercurial/util.py:* in check (glob)
134 135 */mercurial/commands.py:* in serve (glob)
135 136 */mercurial/server.py:* in runservice (glob)
136 137 */mercurial/commandserver.py:* in run (glob)
137 138 */mercurial/commandserver.py:* in _mainloop (glob)
138 139 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
139 140 */mercurial/commandserver.py:* in _runworker (glob)
140 141 */mercurial/commandserver.py:* in _serverequest (glob)
141 142 */mercurial/commandserver.py:* in serve (glob)
142 143 */mercurial/commandserver.py:* in serveone (glob)
143 144 */mercurial/chgserver.py:* in runcommand (glob)
144 145 */mercurial/commandserver.py:* in runcommand (glob)
145 146 */mercurial/commandserver.py:* in _dispatchcommand (glob)
146 147 */mercurial/dispatch.py:* in dispatch (glob)
147 148 */mercurial/dispatch.py:* in _rundispatch (glob)
148 149 */mercurial/dispatch.py:* in _runcatch (glob)
149 150 */mercurial/dispatch.py:* in _callcatch (glob)
150 151 */mercurial/scmutil.py:* in callcatch (glob)
151 152 */mercurial/dispatch.py:* in _runcatchfunc (glob)
152 153 */mercurial/dispatch.py:* in _dispatch (glob)
153 154 */mercurial/dispatch.py:* in runcommand (glob)
154 155 */mercurial/dispatch.py:* in _runcommand (glob)
155 156 */mercurial/dispatch.py:* in <lambda> (glob)
156 157 */mercurial/util.py:* in check (glob)
157 158 $TESTTMP/buggylocking.py:* in buggylocking (glob)
158 159 #endif
160 #if pyoxidizer
161 $ hg buggylocking --traceback
162 devel-warn: "wlock" acquired after "lock" at:
163 <string>:* (glob)
164 mercurial.dispatch:* in run (glob)
165 mercurial.dispatch:* in dispatch (glob)
166 mercurial.dispatch:* in _rundispatch (glob)
167 mercurial.dispatch:* in _runcatch (glob)
168 mercurial.dispatch:* in _callcatch (glob)
169 mercurial.scmutil:* in callcatch (glob)
170 mercurial.dispatch:* in _runcatchfunc (glob)
171 mercurial.dispatch:* in _dispatch (glob)
172 mercurial.dispatch:* in runcommand (glob)
173 mercurial.dispatch:* in _runcommand (glob)
174 mercurial.dispatch:* in <lambda> (glob)
175 mercurial.util:* in check (glob)
176 $TESTTMP/buggylocking.py:* in buggylocking (glob)
177 #endif
159 178 $ hg properlocking
160 179 $ hg nowaitlocking
161 180
162 181 Writing without lock
163 182
164 183 $ hg no-wlock-write
165 184 devel-warn: write with no wlock: "branch" at: $TESTTMP/buggylocking.py:* (nowlockwrite) (glob)
166 185
167 186 $ hg no-lock-write
168 187 devel-warn: write with no lock: "fncache" at: $TESTTMP/buggylocking.py:* (nolockwrite) (glob)
169 188
170 189 Stripping from a transaction
171 190
172 191 $ echo a > a
173 192 $ hg add a
174 193 $ hg commit -m a
175 194 $ hg stripintr 2>&1 | egrep -v '^(\*\*| )'
176 195 Traceback (most recent call last):
177 196 *ProgrammingError: cannot strip from inside a transaction (glob)
178 197
179 198 $ hg oldanddeprecated
180 199 devel-warn: foorbar is deprecated, go shopping
181 200 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
182 201
183 #if no-chg
202 #if no-chg no-pyoxidizer
184 203 $ hg oldanddeprecated --traceback
185 204 devel-warn: foorbar is deprecated, go shopping
186 205 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
187 206 */hg:* in <module> (glob) (?)
188 207 */mercurial/dispatch.py:* in run (glob)
189 208 */mercurial/dispatch.py:* in dispatch (glob)
190 209 */mercurial/dispatch.py:* in _rundispatch (glob)
191 210 */mercurial/dispatch.py:* in _runcatch (glob)
192 211 */mercurial/dispatch.py:* in _callcatch (glob)
193 212 */mercurial/scmutil.py* in callcatch (glob)
194 213 */mercurial/dispatch.py:* in _runcatchfunc (glob)
195 214 */mercurial/dispatch.py:* in _dispatch (glob)
196 215 */mercurial/dispatch.py:* in runcommand (glob)
197 216 */mercurial/dispatch.py:* in _runcommand (glob)
198 217 */mercurial/dispatch.py:* in <lambda> (glob)
199 218 */mercurial/util.py:* in check (glob)
200 219 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
201 #else
220 #endif
221 #if chg no-pyoxidizer
202 222 $ hg oldanddeprecated --traceback
203 223 devel-warn: foorbar is deprecated, go shopping
204 224 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
205 225 */hg:* in <module> (glob)
206 226 */mercurial/dispatch.py:* in run (glob)
207 227 */mercurial/dispatch.py:* in dispatch (glob)
208 228 */mercurial/dispatch.py:* in _rundispatch (glob)
209 229 */mercurial/dispatch.py:* in _runcatch (glob)
210 230 */mercurial/dispatch.py:* in _callcatch (glob)
211 231 */mercurial/scmutil.py:* in callcatch (glob)
212 232 */mercurial/dispatch.py:* in _runcatchfunc (glob)
213 233 */mercurial/dispatch.py:* in _dispatch (glob)
214 234 */mercurial/dispatch.py:* in runcommand (glob)
215 235 */mercurial/dispatch.py:* in _runcommand (glob)
216 236 */mercurial/dispatch.py:* in <lambda> (glob)
217 237 */mercurial/util.py:* in check (glob)
218 238 */mercurial/commands.py:* in serve (glob)
219 239 */mercurial/server.py:* in runservice (glob)
220 240 */mercurial/commandserver.py:* in run (glob)
221 241 */mercurial/commandserver.py:* in _mainloop (glob)
222 242 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
223 243 */mercurial/commandserver.py:* in _runworker (glob)
224 244 */mercurial/commandserver.py:* in _serverequest (glob)
225 245 */mercurial/commandserver.py:* in serve (glob)
226 246 */mercurial/commandserver.py:* in serveone (glob)
227 247 */mercurial/chgserver.py:* in runcommand (glob)
228 248 */mercurial/commandserver.py:* in runcommand (glob)
229 249 */mercurial/commandserver.py:* in _dispatchcommand (glob)
230 250 */mercurial/dispatch.py:* in dispatch (glob)
231 251 */mercurial/dispatch.py:* in _rundispatch (glob)
232 252 */mercurial/dispatch.py:* in _runcatch (glob)
233 253 */mercurial/dispatch.py:* in _callcatch (glob)
234 254 */mercurial/scmutil.py:* in callcatch (glob)
235 255 */mercurial/dispatch.py:* in _runcatchfunc (glob)
236 256 */mercurial/dispatch.py:* in _dispatch (glob)
237 257 */mercurial/dispatch.py:* in runcommand (glob)
238 258 */mercurial/dispatch.py:* in _runcommand (glob)
239 259 */mercurial/dispatch.py:* in <lambda> (glob)
240 260 */mercurial/util.py:* in check (glob)
241 261 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
242 262 #endif
263 #if pyoxidizer
264 $ hg oldanddeprecated --traceback
265 devel-warn: foorbar is deprecated, go shopping
266 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
267 <string>:* (glob)
268 mercurial.dispatch:* in run (glob)
269 mercurial.dispatch:* in dispatch (glob)
270 mercurial.dispatch:* in _rundispatch (glob)
271 mercurial.dispatch:* in _runcatch (glob)
272 mercurial.dispatch:* in _callcatch (glob)
273 mercurial.scmutil:* in callcatch (glob)
274 mercurial.dispatch:* in _runcatchfunc (glob)
275 mercurial.dispatch:* in _dispatch (glob)
276 mercurial.dispatch:* in runcommand (glob)
277 mercurial.dispatch:* in _runcommand (glob)
278 mercurial.dispatch:* in <lambda> (glob)
279 mercurial.util:* in check (glob)
280 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
281 #endif
243 282
244 #if no-chg
283 #if no-chg no-pyoxidizer
245 284 $ hg blackbox -l 7
246 285 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
247 286 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
248 287 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
249 288 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
250 289 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
251 290 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
252 291 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
253 292 */hg:* in <module> (glob) (?)
254 293 */mercurial/dispatch.py:* in run (glob)
255 294 */mercurial/dispatch.py:* in dispatch (glob)
256 295 */mercurial/dispatch.py:* in _rundispatch (glob)
257 296 */mercurial/dispatch.py:* in _runcatch (glob)
258 297 */mercurial/dispatch.py:* in _callcatch (glob)
259 298 */mercurial/scmutil.py* in callcatch (glob)
260 299 */mercurial/dispatch.py:* in _runcatchfunc (glob)
261 300 */mercurial/dispatch.py:* in _dispatch (glob)
262 301 */mercurial/dispatch.py:* in runcommand (glob)
263 302 */mercurial/dispatch.py:* in _runcommand (glob)
264 303 */mercurial/dispatch.py:* in <lambda> (glob)
265 304 */mercurial/util.py:* in check (glob)
266 305 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
267 306 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
268 307 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
269 #else
308 #endif
309 #if chg no-pyoxidizer
270 310 $ hg blackbox -l 7
271 311 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
272 312 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
273 313 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
274 314 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
275 315 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
276 316 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
277 317 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
278 318 */hg:* in <module> (glob)
279 319 */mercurial/dispatch.py:* in run (glob)
280 320 */mercurial/dispatch.py:* in dispatch (glob)
281 321 */mercurial/dispatch.py:* in _rundispatch (glob)
282 322 */mercurial/dispatch.py:* in _runcatch (glob)
283 323 */mercurial/dispatch.py:* in _callcatch (glob)
284 324 */mercurial/scmutil.py:* in callcatch (glob)
285 325 */mercurial/dispatch.py:* in _runcatchfunc (glob)
286 326 */mercurial/dispatch.py:* in _dispatch (glob)
287 327 */mercurial/dispatch.py:* in runcommand (glob)
288 328 */mercurial/dispatch.py:* in _runcommand (glob)
289 329 */mercurial/dispatch.py:* in <lambda> (glob)
290 330 */mercurial/util.py:* in check (glob)
291 331 */mercurial/commands.py:* in serve (glob)
292 332 */mercurial/server.py:* in runservice (glob)
293 333 */mercurial/commandserver.py:* in run (glob)
294 334 */mercurial/commandserver.py:* in _mainloop (glob)
295 335 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
296 336 */mercurial/commandserver.py:* in _runworker (glob)
297 337 */mercurial/commandserver.py:* in _serverequest (glob)
298 338 */mercurial/commandserver.py:* in serve (glob)
299 339 */mercurial/commandserver.py:* in serveone (glob)
300 340 */mercurial/chgserver.py:* in runcommand (glob)
301 341 */mercurial/commandserver.py:* in runcommand (glob)
302 342 */mercurial/commandserver.py:* in _dispatchcommand (glob)
303 343 */mercurial/dispatch.py:* in dispatch (glob)
304 344 */mercurial/dispatch.py:* in _rundispatch (glob)
305 345 */mercurial/dispatch.py:* in _runcatch (glob)
306 346 */mercurial/dispatch.py:* in _callcatch (glob)
307 347 */mercurial/scmutil.py:* in callcatch (glob)
308 348 */mercurial/dispatch.py:* in _runcatchfunc (glob)
309 349 */mercurial/dispatch.py:* in _dispatch (glob)
310 350 */mercurial/dispatch.py:* in runcommand (glob)
311 351 */mercurial/dispatch.py:* in _runcommand (glob)
312 352 */mercurial/dispatch.py:* in <lambda> (glob)
313 353 */mercurial/util.py:* in check (glob)
314 354 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
315 355 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
316 356 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
317 357 #endif
358 #if pyoxidizer
359 $ hg blackbox -l 7
360 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
361 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
362 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
363 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
364 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
365 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
366 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
367 <string>:* in <module> (glob)
368 mercurial.dispatch:* in run (glob)
369 mercurial.dispatch:* in dispatch (glob)
370 mercurial.dispatch:* in _rundispatch (glob)
371 mercurial.dispatch:* in _runcatch (glob)
372 mercurial.dispatch:* in _callcatch (glob)
373 mercurial.scmutil* in callcatch (glob)
374 mercurial.dispatch:* in _runcatchfunc (glob)
375 mercurial.dispatch:* in _dispatch (glob)
376 mercurial.dispatch:* in runcommand (glob)
377 mercurial.dispatch:* in _runcommand (glob)
378 mercurial.dispatch:* in <lambda> (glob)
379 mercurial.util:* in check (glob)
380 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
381 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
382 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
383 #endif
318 384
319 385 Test programming error failure:
320 386
321 387 $ hg buggytransaction 2>&1 | egrep -v '^ '
322 388 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
323 389 ** which supports versions unknown of Mercurial.
324 390 ** Please disable "buggylocking" and try your action again.
325 391 ** If that fixes the bug please report it to the extension author.
326 392 ** Python * (glob)
327 393 ** Mercurial Distributed SCM (*) (glob)
328 394 ** Extensions loaded: * (glob)
329 395 ** ProgrammingError: transaction requires locking
330 396 Traceback (most recent call last):
331 397 *ProgrammingError: transaction requires locking (glob)
332 398
333 399 $ hg programmingerror 2>&1 | egrep -v '^ '
334 400 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
335 401 ** which supports versions unknown of Mercurial.
336 402 ** Please disable "buggylocking" and try your action again.
337 403 ** If that fixes the bug please report it to the extension author.
338 404 ** Python * (glob)
339 405 ** Mercurial Distributed SCM (*) (glob)
340 406 ** Extensions loaded: * (glob)
341 407 ** ProgrammingError: something went wrong
342 408 ** (try again)
343 409 Traceback (most recent call last):
344 410 *ProgrammingError: something went wrong (glob)
345 411
346 412 Old style deprecation warning
347 413
348 414 $ hg nouiwarning
349 415 $TESTTMP/buggylocking.py:*: DeprecationWarning: this is a test (glob)
350 416 (compatibility will be dropped after Mercurial-13.37, update your code.)
351 417 util.nouideprecwarn(b'this is a test', b'13.37')
352 418
353 419 (disabled outside of test run)
354 420
355 421 $ HGEMITWARNINGS= hg nouiwarning
356 422
357 423 Test warning on config option access and registration
358 424
359 425 $ cat << EOF > ${TESTTMP}/buggyconfig.py
360 426 > """A small extension that tests our developer warnings for config"""
361 427 >
362 428 > from mercurial import configitems, registrar
363 429 >
364 430 > cmdtable = {}
365 431 > command = registrar.command(cmdtable)
366 432 >
367 433 > configtable = {}
368 434 > configitem = registrar.configitem(configtable)
369 435 >
370 436 > configitem(b'test', b'some', default=b'foo')
371 437 > configitem(b'test', b'dynamic', default=configitems.dynamicdefault)
372 438 > configitem(b'test', b'callable', default=list)
373 439 > # overwrite a core config
374 440 > configitem(b'ui', b'quiet', default=False)
375 441 > configitem(b'ui', b'interactive', default=None)
376 442 >
377 443 > @command(b'buggyconfig')
378 444 > def cmdbuggyconfig(ui, repo):
379 445 > repo.ui.config(b'ui', b'quiet', True)
380 446 > repo.ui.config(b'ui', b'interactive', False)
381 447 > repo.ui.config(b'test', b'some', b'bar')
382 448 > repo.ui.config(b'test', b'some', b'foo')
383 449 > repo.ui.config(b'test', b'dynamic', b'some-required-default')
384 450 > repo.ui.config(b'test', b'dynamic')
385 451 > repo.ui.config(b'test', b'callable', [])
386 452 > repo.ui.config(b'test', b'callable', b'foo')
387 453 > repo.ui.config(b'test', b'unregistered')
388 454 > repo.ui.config(b'unregistered', b'unregistered')
389 455 > EOF
390 456
391 457 $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
392 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: */mercurial/extensions.py:* (_loadextra) (glob)
393 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: */mercurial/extensions.py:* (_loadextra) (glob)
458 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
459 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
460 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
461 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
394 462 devel-warn: specifying a mismatched default value for a registered config item: 'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
395 463 devel-warn: specifying a mismatched default value for a registered config item: 'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
396 464 devel-warn: specifying a mismatched default value for a registered config item: 'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
397 465 devel-warn: config item requires an explicit default value: 'test.dynamic' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
398 466 devel-warn: specifying a mismatched default value for a registered config item: 'test.callable' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
399 467 devel-warn: accessing unregistered config item: 'test.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
400 468 devel-warn: accessing unregistered config item: 'unregistered.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
401 469
402 470 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now