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