##// END OF EJS Templates
tests: update test-debugcommands.t stack trace checks for python3.9...
Augie Fackler -
r45098:a7b7a67b default
parent child Browse files
Show More
@@ -1,663 +1,663 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > EOF
4 > EOF
5
5
6 $ hg init debugrevlog
6 $ hg init debugrevlog
7 $ cd debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
10 adding a
11 $ hg rm .
11 $ hg rm .
12 removing a
12 removing a
13 $ hg ci -Am make-it-empty
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
14 $ hg revert --all -r 0
15 adding a
15 adding a
16 $ hg ci -Am make-it-full
16 $ hg ci -Am make-it-full
17 #if reporevlogstore
17 #if reporevlogstore
18 $ hg debugrevlog -c
18 $ hg debugrevlog -c
19 format : 1
19 format : 1
20 flags : inline
20 flags : inline
21
21
22 revisions : 3
22 revisions : 3
23 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
24 normal : 3 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
25 revisions : 3
26 empty : 0 ( 0.00%)
26 empty : 0 ( 0.00%)
27 text : 0 (100.00%)
27 text : 0 (100.00%)
28 delta : 0 (100.00%)
28 delta : 0 (100.00%)
29 snapshot : 3 (100.00%)
29 snapshot : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
31 deltas : 0 ( 0.00%)
31 deltas : 0 ( 0.00%)
32 revision size : 191
32 revision size : 191
33 snapshot : 191 (100.00%)
33 snapshot : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
35 deltas : 0 ( 0.00%)
35 deltas : 0 ( 0.00%)
36
36
37 chunks : 3
37 chunks : 3
38 0x75 (u) : 3 (100.00%)
38 0x75 (u) : 3 (100.00%)
39 chunks size : 191
39 chunks size : 191
40 0x75 (u) : 191 (100.00%)
40 0x75 (u) : 191 (100.00%)
41
41
42 avg chain length : 0
42 avg chain length : 0
43 max chain length : 0
43 max chain length : 0
44 max chain reach : 67
44 max chain reach : 67
45 compression ratio : 0
45 compression ratio : 0
46
46
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
47 uncompressed data size (min/max/avg) : 57 / 66 / 62
48 full revision size (min/max/avg) : 58 / 67 / 63
48 full revision size (min/max/avg) : 58 / 67 / 63
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
49 inter-snapshot size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
50 delta size (min/max/avg) : 0 / 0 / 0
51 $ hg debugrevlog -m
51 $ hg debugrevlog -m
52 format : 1
52 format : 1
53 flags : inline, generaldelta
53 flags : inline, generaldelta
54
54
55 revisions : 3
55 revisions : 3
56 merges : 0 ( 0.00%)
56 merges : 0 ( 0.00%)
57 normal : 3 (100.00%)
57 normal : 3 (100.00%)
58 revisions : 3
58 revisions : 3
59 empty : 1 (33.33%)
59 empty : 1 (33.33%)
60 text : 1 (100.00%)
60 text : 1 (100.00%)
61 delta : 0 ( 0.00%)
61 delta : 0 ( 0.00%)
62 snapshot : 2 (66.67%)
62 snapshot : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
63 lvl-0 : 2 (66.67%)
64 deltas : 0 ( 0.00%)
64 deltas : 0 ( 0.00%)
65 revision size : 88
65 revision size : 88
66 snapshot : 88 (100.00%)
66 snapshot : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
67 lvl-0 : 88 (100.00%)
68 deltas : 0 ( 0.00%)
68 deltas : 0 ( 0.00%)
69
69
70 chunks : 3
70 chunks : 3
71 empty : 1 (33.33%)
71 empty : 1 (33.33%)
72 0x75 (u) : 2 (66.67%)
72 0x75 (u) : 2 (66.67%)
73 chunks size : 88
73 chunks size : 88
74 empty : 0 ( 0.00%)
74 empty : 0 ( 0.00%)
75 0x75 (u) : 88 (100.00%)
75 0x75 (u) : 88 (100.00%)
76
76
77 avg chain length : 0
77 avg chain length : 0
78 max chain length : 0
78 max chain length : 0
79 max chain reach : 44
79 max chain reach : 44
80 compression ratio : 0
80 compression ratio : 0
81
81
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
82 uncompressed data size (min/max/avg) : 0 / 43 / 28
83 full revision size (min/max/avg) : 44 / 44 / 44
83 full revision size (min/max/avg) : 44 / 44 / 44
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
84 inter-snapshot size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
85 delta size (min/max/avg) : 0 / 0 / 0
86 $ hg debugrevlog a
86 $ hg debugrevlog a
87 format : 1
87 format : 1
88 flags : inline, generaldelta
88 flags : inline, generaldelta
89
89
90 revisions : 1
90 revisions : 1
91 merges : 0 ( 0.00%)
91 merges : 0 ( 0.00%)
92 normal : 1 (100.00%)
92 normal : 1 (100.00%)
93 revisions : 1
93 revisions : 1
94 empty : 0 ( 0.00%)
94 empty : 0 ( 0.00%)
95 text : 0 (100.00%)
95 text : 0 (100.00%)
96 delta : 0 (100.00%)
96 delta : 0 (100.00%)
97 snapshot : 1 (100.00%)
97 snapshot : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
98 lvl-0 : 1 (100.00%)
99 deltas : 0 ( 0.00%)
99 deltas : 0 ( 0.00%)
100 revision size : 3
100 revision size : 3
101 snapshot : 3 (100.00%)
101 snapshot : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
102 lvl-0 : 3 (100.00%)
103 deltas : 0 ( 0.00%)
103 deltas : 0 ( 0.00%)
104
104
105 chunks : 1
105 chunks : 1
106 0x75 (u) : 1 (100.00%)
106 0x75 (u) : 1 (100.00%)
107 chunks size : 3
107 chunks size : 3
108 0x75 (u) : 3 (100.00%)
108 0x75 (u) : 3 (100.00%)
109
109
110 avg chain length : 0
110 avg chain length : 0
111 max chain length : 0
111 max chain length : 0
112 max chain reach : 3
112 max chain reach : 3
113 compression ratio : 0
113 compression ratio : 0
114
114
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
115 uncompressed data size (min/max/avg) : 2 / 2 / 2
116 full revision size (min/max/avg) : 3 / 3 / 3
116 full revision size (min/max/avg) : 3 / 3 / 3
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
117 inter-snapshot size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
118 delta size (min/max/avg) : 0 / 0 / 0
119 #endif
119 #endif
120
120
121 Test debugindex, with and without the --verbose/--debug flag
121 Test debugindex, with and without the --verbose/--debug flag
122 $ hg debugrevlogindex a
122 $ hg debugrevlogindex a
123 rev linkrev nodeid p1 p2
123 rev linkrev nodeid p1 p2
124 0 0 b789fdd96dc2 000000000000 000000000000
124 0 0 b789fdd96dc2 000000000000 000000000000
125
125
126 #if no-reposimplestore
126 #if no-reposimplestore
127 $ hg --verbose debugrevlogindex a
127 $ hg --verbose debugrevlogindex a
128 rev offset length linkrev nodeid p1 p2
128 rev offset length linkrev nodeid p1 p2
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
129 0 0 3 0 b789fdd96dc2 000000000000 000000000000
130
130
131 $ hg --debug debugrevlogindex a
131 $ hg --debug debugrevlogindex a
132 rev offset length linkrev nodeid p1 p2
132 rev offset length linkrev nodeid p1 p2
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
133 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
134 #endif
134 #endif
135
135
136 $ hg debugrevlogindex -f 1 a
136 $ hg debugrevlogindex -f 1 a
137 rev flag size link p1 p2 nodeid
137 rev flag size link p1 p2 nodeid
138 0 0000 2 0 -1 -1 b789fdd96dc2
138 0 0000 2 0 -1 -1 b789fdd96dc2
139
139
140 #if no-reposimplestore
140 #if no-reposimplestore
141 $ hg --verbose debugrevlogindex -f 1 a
141 $ hg --verbose debugrevlogindex -f 1 a
142 rev flag offset length size link p1 p2 nodeid
142 rev flag offset length size link p1 p2 nodeid
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
143 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
144
144
145 $ hg --debug debugrevlogindex -f 1 a
145 $ hg --debug debugrevlogindex -f 1 a
146 rev flag offset length size link p1 p2 nodeid
146 rev flag offset length size link p1 p2 nodeid
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
147 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
148 #endif
148 #endif
149
149
150 $ hg debugindex -c
150 $ hg debugindex -c
151 rev linkrev nodeid p1 p2
151 rev linkrev nodeid p1 p2
152 0 0 07f494440405 000000000000 000000000000
152 0 0 07f494440405 000000000000 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
153 1 1 8cccb4b5fec2 07f494440405 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
154 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
155 $ hg debugindex -c --debug
155 $ hg debugindex -c --debug
156 rev linkrev nodeid p1 p2
156 rev linkrev nodeid p1 p2
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
157 0 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
158 1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 07f4944404050f47db2e5c5071e0e84e7a27bba9 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
159 2 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0000000000000000000000000000000000000000
160 $ hg debugindex -m
160 $ hg debugindex -m
161 rev linkrev nodeid p1 p2
161 rev linkrev nodeid p1 p2
162 0 0 a0c8bcbbb45c 000000000000 000000000000
162 0 0 a0c8bcbbb45c 000000000000 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
163 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
164 2 2 a35b10320954 57faf8a737ae 000000000000
165 $ hg debugindex -m --debug
165 $ hg debugindex -m --debug
166 rev linkrev nodeid p1 p2
166 rev linkrev nodeid p1 p2
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
167 0 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
168 1 1 57faf8a737ae7faf490582941a82319ba6529dca a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
169 2 2 a35b103209548032201c16c7688cb2657f037a38 57faf8a737ae7faf490582941a82319ba6529dca 0000000000000000000000000000000000000000
170 $ hg debugindex a
170 $ hg debugindex a
171 rev linkrev nodeid p1 p2
171 rev linkrev nodeid p1 p2
172 0 0 b789fdd96dc2 000000000000 000000000000
172 0 0 b789fdd96dc2 000000000000 000000000000
173 $ hg debugindex --debug a
173 $ hg debugindex --debug a
174 rev linkrev nodeid p1 p2
174 rev linkrev nodeid p1 p2
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
175 0 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
176
176
177 debugdelta chain basic output
177 debugdelta chain basic output
178
178
179 #if reporevlogstore pure
179 #if reporevlogstore pure
180 $ hg debugindexstats
180 $ hg debugindexstats
181 abort: debugindexstats only works with native code
181 abort: debugindexstats only works with native code
182 [255]
182 [255]
183 #endif
183 #endif
184 #if reporevlogstore no-pure
184 #if reporevlogstore no-pure
185 $ hg debugindexstats
185 $ hg debugindexstats
186 node trie capacity: 4
186 node trie capacity: 4
187 node trie count: 2
187 node trie count: 2
188 node trie depth: 1
188 node trie depth: 1
189 node trie last rev scanned: -1
189 node trie last rev scanned: -1
190 node trie lookups: 4
190 node trie lookups: 4
191 node trie misses: 1
191 node trie misses: 1
192 node trie splits: 1
192 node trie splits: 1
193 revs in memory: 3
193 revs in memory: 3
194 #endif
194 #endif
195
195
196 #if reporevlogstore no-pure
196 #if reporevlogstore no-pure
197 $ hg debugdeltachain -m
197 $ hg debugdeltachain -m
198 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
198 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
199 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
199 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
200 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
200 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
201 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
201 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
202
202
203 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
203 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
204 0 1 1
204 0 1 1
205 1 2 1
205 1 2 1
206 2 3 1
206 2 3 1
207
207
208 $ hg debugdeltachain -m -Tjson
208 $ hg debugdeltachain -m -Tjson
209 [
209 [
210 {
210 {
211 "chainid": 1,
211 "chainid": 1,
212 "chainlen": 1,
212 "chainlen": 1,
213 "chainratio": 1.02325581395, (no-py3 !)
213 "chainratio": 1.02325581395, (no-py3 !)
214 "chainratio": 1.0232558139534884, (py3 !)
214 "chainratio": 1.0232558139534884, (py3 !)
215 "chainsize": 44,
215 "chainsize": 44,
216 "compsize": 44,
216 "compsize": 44,
217 "deltatype": "base",
217 "deltatype": "base",
218 "extradist": 0,
218 "extradist": 0,
219 "extraratio": 0.0,
219 "extraratio": 0.0,
220 "largestblock": 44,
220 "largestblock": 44,
221 "lindist": 44,
221 "lindist": 44,
222 "prevrev": -1,
222 "prevrev": -1,
223 "readdensity": 1.0,
223 "readdensity": 1.0,
224 "readsize": 44,
224 "readsize": 44,
225 "rev": 0,
225 "rev": 0,
226 "srchunks": 1,
226 "srchunks": 1,
227 "uncompsize": 43
227 "uncompsize": 43
228 },
228 },
229 {
229 {
230 "chainid": 2,
230 "chainid": 2,
231 "chainlen": 1,
231 "chainlen": 1,
232 "chainratio": 0,
232 "chainratio": 0,
233 "chainsize": 0,
233 "chainsize": 0,
234 "compsize": 0,
234 "compsize": 0,
235 "deltatype": "base",
235 "deltatype": "base",
236 "extradist": 0,
236 "extradist": 0,
237 "extraratio": 0,
237 "extraratio": 0,
238 "largestblock": 0,
238 "largestblock": 0,
239 "lindist": 0,
239 "lindist": 0,
240 "prevrev": -1,
240 "prevrev": -1,
241 "readdensity": 1,
241 "readdensity": 1,
242 "readsize": 0,
242 "readsize": 0,
243 "rev": 1,
243 "rev": 1,
244 "srchunks": 1,
244 "srchunks": 1,
245 "uncompsize": 0
245 "uncompsize": 0
246 },
246 },
247 {
247 {
248 "chainid": 3,
248 "chainid": 3,
249 "chainlen": 1,
249 "chainlen": 1,
250 "chainratio": 1.02325581395, (no-py3 !)
250 "chainratio": 1.02325581395, (no-py3 !)
251 "chainratio": 1.0232558139534884, (py3 !)
251 "chainratio": 1.0232558139534884, (py3 !)
252 "chainsize": 44,
252 "chainsize": 44,
253 "compsize": 44,
253 "compsize": 44,
254 "deltatype": "base",
254 "deltatype": "base",
255 "extradist": 0,
255 "extradist": 0,
256 "extraratio": 0.0,
256 "extraratio": 0.0,
257 "largestblock": 44,
257 "largestblock": 44,
258 "lindist": 44,
258 "lindist": 44,
259 "prevrev": -1,
259 "prevrev": -1,
260 "readdensity": 1.0,
260 "readdensity": 1.0,
261 "readsize": 44,
261 "readsize": 44,
262 "rev": 2,
262 "rev": 2,
263 "srchunks": 1,
263 "srchunks": 1,
264 "uncompsize": 43
264 "uncompsize": 43
265 }
265 }
266 ]
266 ]
267
267
268 debugdelta chain with sparse read enabled
268 debugdelta chain with sparse read enabled
269
269
270 $ cat >> $HGRCPATH <<EOF
270 $ cat >> $HGRCPATH <<EOF
271 > [experimental]
271 > [experimental]
272 > sparse-read = True
272 > sparse-read = True
273 > EOF
273 > EOF
274 $ hg debugdeltachain -m
274 $ hg debugdeltachain -m
275 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
275 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
276 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
276 0 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
277 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
277 1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
278 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
278 2 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
279
279
280 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
280 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
281 0 1 1 44 44 1.0
281 0 1 1 44 44 1.0
282 1 2 1 0 0 1
282 1 2 1 0 0 1
283 2 3 1 44 44 1.0
283 2 3 1 44 44 1.0
284
284
285 $ hg debugdeltachain -m -Tjson
285 $ hg debugdeltachain -m -Tjson
286 [
286 [
287 {
287 {
288 "chainid": 1,
288 "chainid": 1,
289 "chainlen": 1,
289 "chainlen": 1,
290 "chainratio": 1.02325581395, (no-py3 !)
290 "chainratio": 1.02325581395, (no-py3 !)
291 "chainratio": 1.0232558139534884, (py3 !)
291 "chainratio": 1.0232558139534884, (py3 !)
292 "chainsize": 44,
292 "chainsize": 44,
293 "compsize": 44,
293 "compsize": 44,
294 "deltatype": "base",
294 "deltatype": "base",
295 "extradist": 0,
295 "extradist": 0,
296 "extraratio": 0.0,
296 "extraratio": 0.0,
297 "largestblock": 44,
297 "largestblock": 44,
298 "lindist": 44,
298 "lindist": 44,
299 "prevrev": -1,
299 "prevrev": -1,
300 "readdensity": 1.0,
300 "readdensity": 1.0,
301 "readsize": 44,
301 "readsize": 44,
302 "rev": 0,
302 "rev": 0,
303 "srchunks": 1,
303 "srchunks": 1,
304 "uncompsize": 43
304 "uncompsize": 43
305 },
305 },
306 {
306 {
307 "chainid": 2,
307 "chainid": 2,
308 "chainlen": 1,
308 "chainlen": 1,
309 "chainratio": 0,
309 "chainratio": 0,
310 "chainsize": 0,
310 "chainsize": 0,
311 "compsize": 0,
311 "compsize": 0,
312 "deltatype": "base",
312 "deltatype": "base",
313 "extradist": 0,
313 "extradist": 0,
314 "extraratio": 0,
314 "extraratio": 0,
315 "largestblock": 0,
315 "largestblock": 0,
316 "lindist": 0,
316 "lindist": 0,
317 "prevrev": -1,
317 "prevrev": -1,
318 "readdensity": 1,
318 "readdensity": 1,
319 "readsize": 0,
319 "readsize": 0,
320 "rev": 1,
320 "rev": 1,
321 "srchunks": 1,
321 "srchunks": 1,
322 "uncompsize": 0
322 "uncompsize": 0
323 },
323 },
324 {
324 {
325 "chainid": 3,
325 "chainid": 3,
326 "chainlen": 1,
326 "chainlen": 1,
327 "chainratio": 1.02325581395, (no-py3 !)
327 "chainratio": 1.02325581395, (no-py3 !)
328 "chainratio": 1.0232558139534884, (py3 !)
328 "chainratio": 1.0232558139534884, (py3 !)
329 "chainsize": 44,
329 "chainsize": 44,
330 "compsize": 44,
330 "compsize": 44,
331 "deltatype": "base",
331 "deltatype": "base",
332 "extradist": 0,
332 "extradist": 0,
333 "extraratio": 0.0,
333 "extraratio": 0.0,
334 "largestblock": 44,
334 "largestblock": 44,
335 "lindist": 44,
335 "lindist": 44,
336 "prevrev": -1,
336 "prevrev": -1,
337 "readdensity": 1.0,
337 "readdensity": 1.0,
338 "readsize": 44,
338 "readsize": 44,
339 "rev": 2,
339 "rev": 2,
340 "srchunks": 1,
340 "srchunks": 1,
341 "uncompsize": 43
341 "uncompsize": 43
342 }
342 }
343 ]
343 ]
344
344
345 $ printf "This test checks things.\n" >> a
345 $ printf "This test checks things.\n" >> a
346 $ hg ci -m a
346 $ hg ci -m a
347 $ hg branch other
347 $ hg branch other
348 marked working directory as branch other
348 marked working directory as branch other
349 (branches are permanent and global, did you want a bookmark?)
349 (branches are permanent and global, did you want a bookmark?)
350 $ for i in `$TESTDIR/seq.py 5`; do
350 $ for i in `$TESTDIR/seq.py 5`; do
351 > printf "shorter ${i}" >> a
351 > printf "shorter ${i}" >> a
352 > hg ci -m "a other:$i"
352 > hg ci -m "a other:$i"
353 > hg up -q default
353 > hg up -q default
354 > printf "for the branch default we want longer chains: ${i}" >> a
354 > printf "for the branch default we want longer chains: ${i}" >> a
355 > hg ci -m "a default:$i"
355 > hg ci -m "a default:$i"
356 > hg up -q other
356 > hg up -q other
357 > done
357 > done
358 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
358 $ hg debugdeltachain a -T '{rev} {srchunks}\n' \
359 > --config experimental.sparse-read.density-threshold=0.50 \
359 > --config experimental.sparse-read.density-threshold=0.50 \
360 > --config experimental.sparse-read.min-gap-size=0
360 > --config experimental.sparse-read.min-gap-size=0
361 0 1
361 0 1
362 1 1
362 1 1
363 2 1
363 2 1
364 3 1
364 3 1
365 4 1
365 4 1
366 5 1
366 5 1
367 6 1
367 6 1
368 7 1
368 7 1
369 8 1
369 8 1
370 9 1
370 9 1
371 10 2
371 10 2
372 11 1
372 11 1
373 $ hg --config extensions.strip= strip --no-backup -r 1
373 $ hg --config extensions.strip= strip --no-backup -r 1
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
374 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375
375
376 Test max chain len
376 Test max chain len
377 $ cat >> $HGRCPATH << EOF
377 $ cat >> $HGRCPATH << EOF
378 > [format]
378 > [format]
379 > maxchainlen=4
379 > maxchainlen=4
380 > EOF
380 > EOF
381
381
382 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
382 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
383 $ hg ci -m a
383 $ hg ci -m a
384 $ printf "b\n" >> a
384 $ printf "b\n" >> a
385 $ hg ci -m a
385 $ hg ci -m a
386 $ printf "c\n" >> a
386 $ printf "c\n" >> a
387 $ hg ci -m a
387 $ hg ci -m a
388 $ printf "d\n" >> a
388 $ printf "d\n" >> a
389 $ hg ci -m a
389 $ hg ci -m a
390 $ printf "e\n" >> a
390 $ printf "e\n" >> a
391 $ hg ci -m a
391 $ hg ci -m a
392 $ printf "f\n" >> a
392 $ printf "f\n" >> a
393 $ hg ci -m a
393 $ hg ci -m a
394 $ printf 'g\n' >> a
394 $ printf 'g\n' >> a
395 $ hg ci -m a
395 $ hg ci -m a
396 $ printf 'h\n' >> a
396 $ printf 'h\n' >> a
397 $ hg ci -m a
397 $ hg ci -m a
398
398
399 $ hg debugrevlog -d a
399 $ hg debugrevlog -d a
400 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
400 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
401 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
401 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
402 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
402 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
403 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
403 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
404 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
404 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
405 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
405 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
406 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
406 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
407 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
407 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
408 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
408 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
409 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
409 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
410 #endif
410 #endif
411
411
412 Test debuglocks command:
412 Test debuglocks command:
413
413
414 $ hg debuglocks
414 $ hg debuglocks
415 lock: free
415 lock: free
416 wlock: free
416 wlock: free
417
417
418 * Test setting the lock
418 * Test setting the lock
419
419
420 waitlock <file> will wait for file to be created. If it isn't in a reasonable
420 waitlock <file> will wait for file to be created. If it isn't in a reasonable
421 amount of time, displays error message and returns 1
421 amount of time, displays error message and returns 1
422 $ waitlock() {
422 $ waitlock() {
423 > start=`date +%s`
423 > start=`date +%s`
424 > timeout=5
424 > timeout=5
425 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
425 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
426 > now=`date +%s`
426 > now=`date +%s`
427 > if [ "`expr $now - $start`" -gt $timeout ]; then
427 > if [ "`expr $now - $start`" -gt $timeout ]; then
428 > echo "timeout: $1 was not created in $timeout seconds"
428 > echo "timeout: $1 was not created in $timeout seconds"
429 > return 1
429 > return 1
430 > fi
430 > fi
431 > sleep 0.1
431 > sleep 0.1
432 > done
432 > done
433 > }
433 > }
434 $ dolock() {
434 $ dolock() {
435 > {
435 > {
436 > waitlock .hg/unlock
436 > waitlock .hg/unlock
437 > rm -f .hg/unlock
437 > rm -f .hg/unlock
438 > echo y
438 > echo y
439 > } | hg debuglocks "$@" > /dev/null
439 > } | hg debuglocks "$@" > /dev/null
440 > }
440 > }
441 $ dolock -s &
441 $ dolock -s &
442 $ waitlock .hg/store/lock
442 $ waitlock .hg/store/lock
443
443
444 $ hg debuglocks
444 $ hg debuglocks
445 lock: user *, process * (*s) (glob)
445 lock: user *, process * (*s) (glob)
446 wlock: free
446 wlock: free
447 [1]
447 [1]
448 $ touch .hg/unlock
448 $ touch .hg/unlock
449 $ wait
449 $ wait
450 $ [ -f .hg/store/lock ] || echo "There is no lock"
450 $ [ -f .hg/store/lock ] || echo "There is no lock"
451 There is no lock
451 There is no lock
452
452
453 * Test setting the wlock
453 * Test setting the wlock
454
454
455 $ dolock -S &
455 $ dolock -S &
456 $ waitlock .hg/wlock
456 $ waitlock .hg/wlock
457
457
458 $ hg debuglocks
458 $ hg debuglocks
459 lock: free
459 lock: free
460 wlock: user *, process * (*s) (glob)
460 wlock: user *, process * (*s) (glob)
461 [1]
461 [1]
462 $ touch .hg/unlock
462 $ touch .hg/unlock
463 $ wait
463 $ wait
464 $ [ -f .hg/wlock ] || echo "There is no wlock"
464 $ [ -f .hg/wlock ] || echo "There is no wlock"
465 There is no wlock
465 There is no wlock
466
466
467 * Test setting both locks
467 * Test setting both locks
468
468
469 $ dolock -Ss &
469 $ dolock -Ss &
470 $ waitlock .hg/wlock && waitlock .hg/store/lock
470 $ waitlock .hg/wlock && waitlock .hg/store/lock
471
471
472 $ hg debuglocks
472 $ hg debuglocks
473 lock: user *, process * (*s) (glob)
473 lock: user *, process * (*s) (glob)
474 wlock: user *, process * (*s) (glob)
474 wlock: user *, process * (*s) (glob)
475 [2]
475 [2]
476
476
477 * Test failing to set a lock
477 * Test failing to set a lock
478
478
479 $ hg debuglocks -s
479 $ hg debuglocks -s
480 abort: lock is already held
480 abort: lock is already held
481 [255]
481 [255]
482
482
483 $ hg debuglocks -S
483 $ hg debuglocks -S
484 abort: wlock is already held
484 abort: wlock is already held
485 [255]
485 [255]
486
486
487 $ touch .hg/unlock
487 $ touch .hg/unlock
488 $ wait
488 $ wait
489
489
490 $ hg debuglocks
490 $ hg debuglocks
491 lock: free
491 lock: free
492 wlock: free
492 wlock: free
493
493
494 * Test forcing the lock
494 * Test forcing the lock
495
495
496 $ dolock -s &
496 $ dolock -s &
497 $ waitlock .hg/store/lock
497 $ waitlock .hg/store/lock
498
498
499 $ hg debuglocks
499 $ hg debuglocks
500 lock: user *, process * (*s) (glob)
500 lock: user *, process * (*s) (glob)
501 wlock: free
501 wlock: free
502 [1]
502 [1]
503
503
504 $ hg debuglocks -L
504 $ hg debuglocks -L
505
505
506 $ hg debuglocks
506 $ hg debuglocks
507 lock: free
507 lock: free
508 wlock: free
508 wlock: free
509
509
510 $ touch .hg/unlock
510 $ touch .hg/unlock
511 $ wait
511 $ wait
512
512
513 * Test forcing the wlock
513 * Test forcing the wlock
514
514
515 $ dolock -S &
515 $ dolock -S &
516 $ waitlock .hg/wlock
516 $ waitlock .hg/wlock
517
517
518 $ hg debuglocks
518 $ hg debuglocks
519 lock: free
519 lock: free
520 wlock: user *, process * (*s) (glob)
520 wlock: user *, process * (*s) (glob)
521 [1]
521 [1]
522
522
523 $ hg debuglocks -W
523 $ hg debuglocks -W
524
524
525 $ hg debuglocks
525 $ hg debuglocks
526 lock: free
526 lock: free
527 wlock: free
527 wlock: free
528
528
529 $ touch .hg/unlock
529 $ touch .hg/unlock
530 $ wait
530 $ wait
531
531
532 Test WdirUnsupported exception
532 Test WdirUnsupported exception
533
533
534 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
534 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
535 abort: working directory revision cannot be specified
535 abort: working directory revision cannot be specified
536 [255]
536 [255]
537
537
538 Test cache warming command
538 Test cache warming command
539
539
540 $ rm -rf .hg/cache/
540 $ rm -rf .hg/cache/
541 $ hg debugupdatecaches --debug
541 $ hg debugupdatecaches --debug
542 updating the branch cache
542 updating the branch cache
543 $ ls -r .hg/cache/*
543 $ ls -r .hg/cache/*
544 .hg/cache/tags2-served
544 .hg/cache/tags2-served
545 .hg/cache/tags2
545 .hg/cache/tags2
546 .hg/cache/rbc-revs-v1
546 .hg/cache/rbc-revs-v1
547 .hg/cache/rbc-names-v1
547 .hg/cache/rbc-names-v1
548 .hg/cache/hgtagsfnodes1
548 .hg/cache/hgtagsfnodes1
549 .hg/cache/branch2-visible-hidden
549 .hg/cache/branch2-visible-hidden
550 .hg/cache/branch2-visible
550 .hg/cache/branch2-visible
551 .hg/cache/branch2-served.hidden
551 .hg/cache/branch2-served.hidden
552 .hg/cache/branch2-served
552 .hg/cache/branch2-served
553 .hg/cache/branch2-immutable
553 .hg/cache/branch2-immutable
554 .hg/cache/branch2-base
554 .hg/cache/branch2-base
555
555
556 Test debugcolor
556 Test debugcolor
557
557
558 #if no-windows
558 #if no-windows
559 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
559 $ hg debugcolor --style --color always | egrep 'mode|style|log\.'
560 color mode: 'ansi'
560 color mode: 'ansi'
561 available style:
561 available style:
562 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
562 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
563 #endif
563 #endif
564
564
565 $ hg debugcolor --style --color never
565 $ hg debugcolor --style --color never
566 color mode: None
566 color mode: None
567 available style:
567 available style:
568
568
569 $ cd ..
569 $ cd ..
570
570
571 Test internal debugstacktrace command
571 Test internal debugstacktrace command
572
572
573 $ cat > debugstacktrace.py << EOF
573 $ cat > debugstacktrace.py << EOF
574 > from __future__ import absolute_import
574 > from __future__ import absolute_import
575 > from mercurial import (
575 > from mercurial import (
576 > pycompat,
576 > pycompat,
577 > util,
577 > util,
578 > )
578 > )
579 > def f():
579 > def f():
580 > util.debugstacktrace(f=pycompat.stdout)
580 > util.debugstacktrace(f=pycompat.stdout)
581 > g()
581 > g()
582 > def g():
582 > def g():
583 > util.dst(b'hello from g\\n', skip=1)
583 > util.dst(b'hello from g\\n', skip=1)
584 > h()
584 > h()
585 > def h():
585 > def h():
586 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
586 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
587 > f()
587 > f()
588 > EOF
588 > EOF
589 $ "$PYTHON" debugstacktrace.py
589 $ "$PYTHON" debugstacktrace.py
590 stacktrace at:
590 stacktrace at:
591 debugstacktrace.py:14 in * (glob)
591 *debugstacktrace.py:14 in * (glob)
592 debugstacktrace.py:7 in f
592 *debugstacktrace.py:7 in f (glob)
593 hello from g at:
593 hello from g at:
594 debugstacktrace.py:14 in * (glob)
594 *debugstacktrace.py:14 in * (glob)
595 debugstacktrace.py:8 in f
595 *debugstacktrace.py:8 in f (glob)
596 hi ...
596 hi ...
597 from h hidden in g at:
597 from h hidden in g at:
598 debugstacktrace.py:8 in f
598 *debugstacktrace.py:8 in f (glob)
599 debugstacktrace.py:11 in g
599 *debugstacktrace.py:11 in g (glob)
600
600
601 Test debugcapabilities command:
601 Test debugcapabilities command:
602
602
603 $ hg debugcapabilities ./debugrevlog/
603 $ hg debugcapabilities ./debugrevlog/
604 Main capabilities:
604 Main capabilities:
605 branchmap
605 branchmap
606 $USUAL_BUNDLE2_CAPS$
606 $USUAL_BUNDLE2_CAPS$
607 getbundle
607 getbundle
608 known
608 known
609 lookup
609 lookup
610 pushkey
610 pushkey
611 unbundle
611 unbundle
612 Bundle2 capabilities:
612 Bundle2 capabilities:
613 HG20
613 HG20
614 bookmarks
614 bookmarks
615 changegroup
615 changegroup
616 01
616 01
617 02
617 02
618 checkheads
618 checkheads
619 related
619 related
620 digests
620 digests
621 md5
621 md5
622 sha1
622 sha1
623 sha512
623 sha512
624 error
624 error
625 abort
625 abort
626 unsupportedcontent
626 unsupportedcontent
627 pushraced
627 pushraced
628 pushkey
628 pushkey
629 hgtagsfnodes
629 hgtagsfnodes
630 listkeys
630 listkeys
631 phases
631 phases
632 heads
632 heads
633 pushkey
633 pushkey
634 remote-changegroup
634 remote-changegroup
635 http
635 http
636 https
636 https
637 rev-branch-cache
637 rev-branch-cache
638 stream
638 stream
639 v2
639 v2
640
640
641 Test debugpeer
641 Test debugpeer
642
642
643 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
643 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" debugpeer ssh://user@dummy/debugrevlog
644 url: ssh://user@dummy/debugrevlog
644 url: ssh://user@dummy/debugrevlog
645 local: no
645 local: no
646 pushable: yes
646 pushable: yes
647
647
648 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
648 $ hg --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" --debug debugpeer ssh://user@dummy/debugrevlog
649 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
649 running "*" "*/tests/dummyssh" 'user@dummy' 'hg -R debugrevlog serve --stdio' (glob) (no-windows !)
650 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
650 running "*" "*\tests/dummyssh" "user@dummy" "hg -R debugrevlog serve --stdio" (glob) (windows !)
651 devel-peer-request: hello+between
651 devel-peer-request: hello+between
652 devel-peer-request: pairs: 81 bytes
652 devel-peer-request: pairs: 81 bytes
653 sending hello command
653 sending hello command
654 sending between command
654 sending between command
655 remote: 463
655 remote: 463
656 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
656 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
657 remote: 1
657 remote: 1
658 devel-peer-request: protocaps
658 devel-peer-request: protocaps
659 devel-peer-request: caps: * bytes (glob)
659 devel-peer-request: caps: * bytes (glob)
660 sending protocaps command
660 sending protocaps command
661 url: ssh://user@dummy/debugrevlog
661 url: ssh://user@dummy/debugrevlog
662 local: no
662 local: no
663 pushable: yes
663 pushable: yes
General Comments 0
You need to be logged in to leave comments. Login now