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