Show More
@@ -1,727 +1,736 b'' | |||
|
1 | 1 | =================================== |
|
2 | 2 | Test the persistent on-disk nodemap |
|
3 | 3 | =================================== |
|
4 | 4 | |
|
5 | 5 | $ cat << EOF >> $HGRCPATH |
|
6 | 6 | > [format] |
|
7 | 7 | > use-persistent-nodemap=yes |
|
8 | 8 | > [devel] |
|
9 | 9 | > persistent-nodemap=yes |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow |
|
13 | 13 | $ cd test-repo |
|
14 | 14 | |
|
15 | 15 | Check handling of the default slow-path value |
|
16 | 16 | |
|
17 | 17 | #if no-pure no-rust |
|
18 | 18 | |
|
19 | 19 | $ hg id |
|
20 | 20 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
21 | 21 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
22 | 22 | [255] |
|
23 | 23 | |
|
24 | 24 | Unlock further check (we are here to test the feature) |
|
25 | 25 | |
|
26 | 26 | $ cat << EOF >> $HGRCPATH |
|
27 | 27 | > [storage] |
|
28 | 28 | > # to avoid spamming the test |
|
29 | 29 | > revlog.persistent-nodemap.slow-path=allow |
|
30 | 30 | > EOF |
|
31 | 31 | |
|
32 | 32 | #endif |
|
33 | 33 | |
|
34 | #if rust | |
|
35 | ||
|
36 | Reported bug: some Rust code panics when handling the null revision | |
|
37 | ||
|
38 | $ hg log -r 00000000 2>&1 | grep panicked | |
|
39 | thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', hg-cpython/src/revlog.rs:* (glob) | |
|
40 | ||
|
41 | #endif | |
|
42 | ||
|
34 | 43 | |
|
35 | 44 | $ hg debugformat |
|
36 | 45 | format-variant repo |
|
37 | 46 | fncache: yes |
|
38 | 47 | dotencode: yes |
|
39 | 48 | generaldelta: yes |
|
40 | 49 | share-safe: no |
|
41 | 50 | sparserevlog: yes |
|
42 | 51 | sidedata: no |
|
43 | 52 | persistent-nodemap: yes |
|
44 | 53 | copies-sdc: no |
|
45 | 54 | plain-cl-delta: yes |
|
46 | 55 | compression: zlib |
|
47 | 56 | compression-level: default |
|
48 | 57 | $ hg debugbuilddag .+5000 --new-file |
|
49 | 58 | |
|
50 | 59 | $ hg debugnodemap --metadata |
|
51 | 60 | uid: ???????????????? (glob) |
|
52 | 61 | tip-rev: 5000 |
|
53 | 62 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c |
|
54 | 63 | data-length: 121088 |
|
55 | 64 | data-unused: 0 |
|
56 | 65 | data-unused: 0.000% |
|
57 | 66 | $ f --size .hg/store/00changelog.n |
|
58 | 67 | .hg/store/00changelog.n: size=70 |
|
59 | 68 | |
|
60 | 69 | Simple lookup works |
|
61 | 70 | |
|
62 | 71 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` |
|
63 | 72 | $ hg log -r "$ANYNODE" --template '{rev}\n' |
|
64 | 73 | 5000 |
|
65 | 74 | |
|
66 | 75 | |
|
67 | 76 | #if rust |
|
68 | 77 | |
|
69 | 78 | $ f --sha256 .hg/store/00changelog-*.nd |
|
70 | 79 | .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) |
|
71 | 80 | |
|
72 | 81 | $ f --sha256 .hg/store/00manifest-*.nd |
|
73 | 82 | .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) |
|
74 | 83 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
75 | 84 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
76 | 85 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
77 | 86 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
78 | 87 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| |
|
79 | 88 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| |
|
80 | 89 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| |
|
81 | 90 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| |
|
82 | 91 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| |
|
83 | 92 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| |
|
84 | 93 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| |
|
85 | 94 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| |
|
86 | 95 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| |
|
87 | 96 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| |
|
88 | 97 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| |
|
89 | 98 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| |
|
90 | 99 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| |
|
91 | 100 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| |
|
92 | 101 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| |
|
93 | 102 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| |
|
94 | 103 | |
|
95 | 104 | |
|
96 | 105 | #else |
|
97 | 106 | |
|
98 | 107 | $ f --sha256 .hg/store/00changelog-*.nd |
|
99 | 108 | .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) |
|
100 | 109 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
101 | 110 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
102 | 111 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
103 | 112 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
104 | 113 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
105 | 114 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
106 | 115 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| |
|
107 | 116 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
108 | 117 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
109 | 118 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| |
|
110 | 119 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| |
|
111 | 120 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
112 | 121 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
113 | 122 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| |
|
114 | 123 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| |
|
115 | 124 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
116 | 125 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
117 | 126 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
118 | 127 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| |
|
119 | 128 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| |
|
120 | 129 | |
|
121 | 130 | #endif |
|
122 | 131 | |
|
123 | 132 | $ hg debugnodemap --check |
|
124 | 133 | revision in index: 5001 |
|
125 | 134 | revision in nodemap: 5001 |
|
126 | 135 | |
|
127 | 136 | add a new commit |
|
128 | 137 | |
|
129 | 138 | $ hg up |
|
130 | 139 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
131 | 140 | $ echo foo > foo |
|
132 | 141 | $ hg add foo |
|
133 | 142 | |
|
134 | 143 | |
|
135 | 144 | Check slow-path config value handling |
|
136 | 145 | ------------------------------------- |
|
137 | 146 | |
|
138 | 147 | #if no-pure no-rust |
|
139 | 148 | |
|
140 | 149 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
141 | 150 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
142 | 151 | falling back to default value: abort |
|
143 | 152 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
144 | 153 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
145 | 154 | [255] |
|
146 | 155 | |
|
147 | 156 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" |
|
148 | 157 | warning: accessing `persistent-nodemap` repository without associated fast implementation. |
|
149 | 158 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
150 | 159 | changeset: 5000:6b02b8c7b966 |
|
151 | 160 | tag: tip |
|
152 | 161 | user: debugbuilddag |
|
153 | 162 | date: Thu Jan 01 01:23:20 1970 +0000 |
|
154 | 163 | summary: r5000 |
|
155 | 164 | |
|
156 | 165 | $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort" |
|
157 | 166 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
158 | 167 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
159 | 168 | [255] |
|
160 | 169 | |
|
161 | 170 | #else |
|
162 | 171 | |
|
163 | 172 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
164 | 173 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
165 | 174 | falling back to default value: abort |
|
166 | 175 | 6b02b8c7b966+ tip |
|
167 | 176 | |
|
168 | 177 | #endif |
|
169 | 178 | |
|
170 | 179 | $ hg ci -m 'foo' |
|
171 | 180 | |
|
172 | 181 | #if no-pure no-rust |
|
173 | 182 | $ hg debugnodemap --metadata |
|
174 | 183 | uid: ???????????????? (glob) |
|
175 | 184 | tip-rev: 5001 |
|
176 | 185 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
177 | 186 | data-length: 121088 |
|
178 | 187 | data-unused: 0 |
|
179 | 188 | data-unused: 0.000% |
|
180 | 189 | #else |
|
181 | 190 | $ hg debugnodemap --metadata |
|
182 | 191 | uid: ???????????????? (glob) |
|
183 | 192 | tip-rev: 5001 |
|
184 | 193 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
185 | 194 | data-length: 121344 |
|
186 | 195 | data-unused: 256 |
|
187 | 196 | data-unused: 0.211% |
|
188 | 197 | #endif |
|
189 | 198 | |
|
190 | 199 | $ f --size .hg/store/00changelog.n |
|
191 | 200 | .hg/store/00changelog.n: size=70 |
|
192 | 201 | |
|
193 | 202 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) |
|
194 | 203 | |
|
195 | 204 | #if pure |
|
196 | 205 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
197 | 206 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) |
|
198 | 207 | #endif |
|
199 | 208 | |
|
200 | 209 | #if rust |
|
201 | 210 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
202 | 211 | .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) |
|
203 | 212 | #endif |
|
204 | 213 | |
|
205 | 214 | #if no-pure no-rust |
|
206 | 215 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
207 | 216 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) |
|
208 | 217 | #endif |
|
209 | 218 | |
|
210 | 219 | $ hg debugnodemap --check |
|
211 | 220 | revision in index: 5002 |
|
212 | 221 | revision in nodemap: 5002 |
|
213 | 222 | |
|
214 | 223 | Test code path without mmap |
|
215 | 224 | --------------------------- |
|
216 | 225 | |
|
217 | 226 | $ echo bar > bar |
|
218 | 227 | $ hg add bar |
|
219 | 228 | $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no |
|
220 | 229 | |
|
221 | 230 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes |
|
222 | 231 | revision in index: 5003 |
|
223 | 232 | revision in nodemap: 5003 |
|
224 | 233 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no |
|
225 | 234 | revision in index: 5003 |
|
226 | 235 | revision in nodemap: 5003 |
|
227 | 236 | |
|
228 | 237 | |
|
229 | 238 | #if pure |
|
230 | 239 | $ hg debugnodemap --metadata |
|
231 | 240 | uid: ???????????????? (glob) |
|
232 | 241 | tip-rev: 5002 |
|
233 | 242 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
234 | 243 | data-length: 121600 |
|
235 | 244 | data-unused: 512 |
|
236 | 245 | data-unused: 0.421% |
|
237 | 246 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
238 | 247 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) |
|
239 | 248 | #endif |
|
240 | 249 | #if rust |
|
241 | 250 | $ hg debugnodemap --metadata |
|
242 | 251 | uid: ???????????????? (glob) |
|
243 | 252 | tip-rev: 5002 |
|
244 | 253 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
245 | 254 | data-length: 121600 |
|
246 | 255 | data-unused: 512 |
|
247 | 256 | data-unused: 0.421% |
|
248 | 257 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
249 | 258 | .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) |
|
250 | 259 | #endif |
|
251 | 260 | #if no-pure no-rust |
|
252 | 261 | $ hg debugnodemap --metadata |
|
253 | 262 | uid: ???????????????? (glob) |
|
254 | 263 | tip-rev: 5002 |
|
255 | 264 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
256 | 265 | data-length: 121088 |
|
257 | 266 | data-unused: 0 |
|
258 | 267 | data-unused: 0.000% |
|
259 | 268 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
260 | 269 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) |
|
261 | 270 | #endif |
|
262 | 271 | |
|
263 | 272 | Test force warming the cache |
|
264 | 273 | |
|
265 | 274 | $ rm .hg/store/00changelog.n |
|
266 | 275 | $ hg debugnodemap --metadata |
|
267 | 276 | $ hg debugupdatecache |
|
268 | 277 | #if pure |
|
269 | 278 | $ hg debugnodemap --metadata |
|
270 | 279 | uid: ???????????????? (glob) |
|
271 | 280 | tip-rev: 5002 |
|
272 | 281 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
273 | 282 | data-length: 121088 |
|
274 | 283 | data-unused: 0 |
|
275 | 284 | data-unused: 0.000% |
|
276 | 285 | #else |
|
277 | 286 | $ hg debugnodemap --metadata |
|
278 | 287 | uid: ???????????????? (glob) |
|
279 | 288 | tip-rev: 5002 |
|
280 | 289 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
281 | 290 | data-length: 121088 |
|
282 | 291 | data-unused: 0 |
|
283 | 292 | data-unused: 0.000% |
|
284 | 293 | #endif |
|
285 | 294 | |
|
286 | 295 | Check out of sync nodemap |
|
287 | 296 | ========================= |
|
288 | 297 | |
|
289 | 298 | First copy old data on the side. |
|
290 | 299 | |
|
291 | 300 | $ mkdir ../tmp-copies |
|
292 | 301 | $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies |
|
293 | 302 | |
|
294 | 303 | Nodemap lagging behind |
|
295 | 304 | ---------------------- |
|
296 | 305 | |
|
297 | 306 | make a new commit |
|
298 | 307 | |
|
299 | 308 | $ echo bar2 > bar |
|
300 | 309 | $ hg ci -m 'bar2' |
|
301 | 310 | $ NODE=`hg log -r tip -T '{node}\n'` |
|
302 | 311 | $ hg log -r "$NODE" -T '{rev}\n' |
|
303 | 312 | 5003 |
|
304 | 313 | |
|
305 | 314 | If the nodemap is lagging behind, it can catch up fine |
|
306 | 315 | |
|
307 | 316 | $ hg debugnodemap --metadata |
|
308 | 317 | uid: ???????????????? (glob) |
|
309 | 318 | tip-rev: 5003 |
|
310 | 319 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 |
|
311 | 320 | data-length: 121344 (pure !) |
|
312 | 321 | data-length: 121344 (rust !) |
|
313 | 322 | data-length: 121152 (no-rust no-pure !) |
|
314 | 323 | data-unused: 192 (pure !) |
|
315 | 324 | data-unused: 192 (rust !) |
|
316 | 325 | data-unused: 0 (no-rust no-pure !) |
|
317 | 326 | data-unused: 0.158% (pure !) |
|
318 | 327 | data-unused: 0.158% (rust !) |
|
319 | 328 | data-unused: 0.000% (no-rust no-pure !) |
|
320 | 329 | $ cp -f ../tmp-copies/* .hg/store/ |
|
321 | 330 | $ hg debugnodemap --metadata |
|
322 | 331 | uid: ???????????????? (glob) |
|
323 | 332 | tip-rev: 5002 |
|
324 | 333 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
325 | 334 | data-length: 121088 |
|
326 | 335 | data-unused: 0 |
|
327 | 336 | data-unused: 0.000% |
|
328 | 337 | $ hg log -r "$NODE" -T '{rev}\n' |
|
329 | 338 | 5003 |
|
330 | 339 | |
|
331 | 340 | changelog altered |
|
332 | 341 | ----------------- |
|
333 | 342 | |
|
334 | 343 | If the nodemap is not gated behind a requirements, an unaware client can alter |
|
335 | 344 | the repository so the revlog used to generate the nodemap is not longer |
|
336 | 345 | compatible with the persistent nodemap. We need to detect that. |
|
337 | 346 | |
|
338 | 347 | $ hg up "$NODE~5" |
|
339 | 348 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
340 | 349 | $ echo bar > babar |
|
341 | 350 | $ hg add babar |
|
342 | 351 | $ hg ci -m 'babar' |
|
343 | 352 | created new head |
|
344 | 353 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` |
|
345 | 354 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
346 | 355 | 5004 |
|
347 | 356 | |
|
348 | 357 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup |
|
349 | 358 | |
|
350 | 359 | the nodemap should detect the changelog have been tampered with and recover. |
|
351 | 360 | |
|
352 | 361 | $ hg debugnodemap --metadata |
|
353 | 362 | uid: ???????????????? (glob) |
|
354 | 363 | tip-rev: 5002 |
|
355 | 364 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
356 | 365 | data-length: 121536 (pure !) |
|
357 | 366 | data-length: 121088 (rust !) |
|
358 | 367 | data-length: 121088 (no-pure no-rust !) |
|
359 | 368 | data-unused: 448 (pure !) |
|
360 | 369 | data-unused: 0 (rust !) |
|
361 | 370 | data-unused: 0 (no-pure no-rust !) |
|
362 | 371 | data-unused: 0.000% (rust !) |
|
363 | 372 | data-unused: 0.369% (pure !) |
|
364 | 373 | data-unused: 0.000% (no-pure no-rust !) |
|
365 | 374 | |
|
366 | 375 | $ cp -f ../tmp-copies/* .hg/store/ |
|
367 | 376 | $ hg debugnodemap --metadata |
|
368 | 377 | uid: ???????????????? (glob) |
|
369 | 378 | tip-rev: 5002 |
|
370 | 379 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
371 | 380 | data-length: 121088 |
|
372 | 381 | data-unused: 0 |
|
373 | 382 | data-unused: 0.000% |
|
374 | 383 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
375 | 384 | 5002 |
|
376 | 385 | |
|
377 | 386 | missing data file |
|
378 | 387 | ----------------- |
|
379 | 388 | |
|
380 | 389 | $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \ |
|
381 | 390 | > sed 's/uid: //'` |
|
382 | 391 | $ FILE=.hg/store/00changelog-"${UUID}".nd |
|
383 | 392 | $ mv $FILE ../tmp-data-file |
|
384 | 393 | $ cp .hg/store/00changelog.n ../tmp-docket |
|
385 | 394 | |
|
386 | 395 | mercurial don't crash |
|
387 | 396 | |
|
388 | 397 | $ hg log -r . |
|
389 | 398 | changeset: 5002:b355ef8adce0 |
|
390 | 399 | tag: tip |
|
391 | 400 | parent: 4998:d918ad6d18d3 |
|
392 | 401 | user: test |
|
393 | 402 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
394 | 403 | summary: babar |
|
395 | 404 | |
|
396 | 405 | $ hg debugnodemap --metadata |
|
397 | 406 | |
|
398 | 407 | $ hg debugupdatecache |
|
399 | 408 | $ hg debugnodemap --metadata |
|
400 | 409 | uid: * (glob) |
|
401 | 410 | tip-rev: 5002 |
|
402 | 411 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
403 | 412 | data-length: 121088 |
|
404 | 413 | data-unused: 0 |
|
405 | 414 | data-unused: 0.000% |
|
406 | 415 | $ mv ../tmp-data-file $FILE |
|
407 | 416 | $ mv ../tmp-docket .hg/store/00changelog.n |
|
408 | 417 | |
|
409 | 418 | Check transaction related property |
|
410 | 419 | ================================== |
|
411 | 420 | |
|
412 | 421 | An up to date nodemap should be available to shell hooks, |
|
413 | 422 | |
|
414 | 423 | $ echo dsljfl > a |
|
415 | 424 | $ hg add a |
|
416 | 425 | $ hg ci -m a |
|
417 | 426 | $ hg debugnodemap --metadata |
|
418 | 427 | uid: ???????????????? (glob) |
|
419 | 428 | tip-rev: 5003 |
|
420 | 429 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 |
|
421 | 430 | data-length: 121088 |
|
422 | 431 | data-unused: 0 |
|
423 | 432 | data-unused: 0.000% |
|
424 | 433 | $ echo babar2 > babar |
|
425 | 434 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" |
|
426 | 435 | uid: ???????????????? (glob) |
|
427 | 436 | tip-rev: 5004 |
|
428 | 437 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
429 | 438 | data-length: 121280 (pure !) |
|
430 | 439 | data-length: 121280 (rust !) |
|
431 | 440 | data-length: 121088 (no-pure no-rust !) |
|
432 | 441 | data-unused: 192 (pure !) |
|
433 | 442 | data-unused: 192 (rust !) |
|
434 | 443 | data-unused: 0 (no-pure no-rust !) |
|
435 | 444 | data-unused: 0.158% (pure !) |
|
436 | 445 | data-unused: 0.158% (rust !) |
|
437 | 446 | data-unused: 0.000% (no-pure no-rust !) |
|
438 | 447 | $ hg debugnodemap --metadata |
|
439 | 448 | uid: ???????????????? (glob) |
|
440 | 449 | tip-rev: 5004 |
|
441 | 450 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
442 | 451 | data-length: 121280 (pure !) |
|
443 | 452 | data-length: 121280 (rust !) |
|
444 | 453 | data-length: 121088 (no-pure no-rust !) |
|
445 | 454 | data-unused: 192 (pure !) |
|
446 | 455 | data-unused: 192 (rust !) |
|
447 | 456 | data-unused: 0 (no-pure no-rust !) |
|
448 | 457 | data-unused: 0.158% (pure !) |
|
449 | 458 | data-unused: 0.158% (rust !) |
|
450 | 459 | data-unused: 0.000% (no-pure no-rust !) |
|
451 | 460 | |
|
452 | 461 | Another process does not see the pending nodemap content during run. |
|
453 | 462 | |
|
454 | 463 | $ PATH=$RUNTESTDIR/testlib/:$PATH |
|
455 | 464 | $ echo qpoasp > a |
|
456 | 465 | $ hg ci -m a2 \ |
|
457 | 466 | > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \ |
|
458 | 467 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & |
|
459 | 468 | |
|
460 | 469 | (read the repository while the commit transaction is pending) |
|
461 | 470 | |
|
462 | 471 | $ wait-on-file 20 sync-txn-pending && \ |
|
463 | 472 | > hg debugnodemap --metadata && \ |
|
464 | 473 | > wait-on-file 20 sync-txn-close sync-repo-read |
|
465 | 474 | uid: ???????????????? (glob) |
|
466 | 475 | tip-rev: 5004 |
|
467 | 476 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
468 | 477 | data-length: 121280 (pure !) |
|
469 | 478 | data-length: 121280 (rust !) |
|
470 | 479 | data-length: 121088 (no-pure no-rust !) |
|
471 | 480 | data-unused: 192 (pure !) |
|
472 | 481 | data-unused: 192 (rust !) |
|
473 | 482 | data-unused: 0 (no-pure no-rust !) |
|
474 | 483 | data-unused: 0.158% (pure !) |
|
475 | 484 | data-unused: 0.158% (rust !) |
|
476 | 485 | data-unused: 0.000% (no-pure no-rust !) |
|
477 | 486 | $ hg debugnodemap --metadata |
|
478 | 487 | uid: ???????????????? (glob) |
|
479 | 488 | tip-rev: 5005 |
|
480 | 489 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
481 | 490 | data-length: 121536 (pure !) |
|
482 | 491 | data-length: 121536 (rust !) |
|
483 | 492 | data-length: 121088 (no-pure no-rust !) |
|
484 | 493 | data-unused: 448 (pure !) |
|
485 | 494 | data-unused: 448 (rust !) |
|
486 | 495 | data-unused: 0 (no-pure no-rust !) |
|
487 | 496 | data-unused: 0.369% (pure !) |
|
488 | 497 | data-unused: 0.369% (rust !) |
|
489 | 498 | data-unused: 0.000% (no-pure no-rust !) |
|
490 | 499 | |
|
491 | 500 | $ cat output.txt |
|
492 | 501 | |
|
493 | 502 | Check that a failing transaction will properly revert the data |
|
494 | 503 | |
|
495 | 504 | $ echo plakfe > a |
|
496 | 505 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
497 | 506 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
498 | 507 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
499 | 508 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
500 | 509 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" |
|
501 | 510 | transaction abort! |
|
502 | 511 | rollback completed |
|
503 | 512 | abort: This is a late abort |
|
504 | 513 | [255] |
|
505 | 514 | $ hg debugnodemap --metadata |
|
506 | 515 | uid: ???????????????? (glob) |
|
507 | 516 | tip-rev: 5005 |
|
508 | 517 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
509 | 518 | data-length: 121536 (pure !) |
|
510 | 519 | data-length: 121536 (rust !) |
|
511 | 520 | data-length: 121088 (no-pure no-rust !) |
|
512 | 521 | data-unused: 448 (pure !) |
|
513 | 522 | data-unused: 448 (rust !) |
|
514 | 523 | data-unused: 0 (no-pure no-rust !) |
|
515 | 524 | data-unused: 0.369% (pure !) |
|
516 | 525 | data-unused: 0.369% (rust !) |
|
517 | 526 | data-unused: 0.000% (no-pure no-rust !) |
|
518 | 527 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
519 | 528 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
520 | 529 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
521 | 530 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
522 | 531 | |
|
523 | 532 | Check that removing content does not confuse the nodemap |
|
524 | 533 | -------------------------------------------------------- |
|
525 | 534 | |
|
526 | 535 | removing data with rollback |
|
527 | 536 | |
|
528 | 537 | $ echo aso > a |
|
529 | 538 | $ hg ci -m a4 |
|
530 | 539 | $ hg rollback |
|
531 | 540 | repository tip rolled back to revision 5005 (undo commit) |
|
532 | 541 | working directory now based on revision 5005 |
|
533 | 542 | $ hg id -r . |
|
534 | 543 | 90d5d3ba2fc4 tip |
|
535 | 544 | |
|
536 | 545 | roming data with strip |
|
537 | 546 | |
|
538 | 547 | $ echo aso > a |
|
539 | 548 | $ hg ci -m a4 |
|
540 | 549 | $ hg --config extensions.strip= strip -r . --no-backup |
|
541 | 550 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
542 | 551 | $ hg id -r . --traceback |
|
543 | 552 | 90d5d3ba2fc4 tip |
|
544 | 553 | |
|
545 | 554 | Test upgrade / downgrade |
|
546 | 555 | ======================== |
|
547 | 556 | |
|
548 | 557 | downgrading |
|
549 | 558 | |
|
550 | 559 | $ cat << EOF >> .hg/hgrc |
|
551 | 560 | > [format] |
|
552 | 561 | > use-persistent-nodemap=no |
|
553 | 562 | > EOF |
|
554 | 563 | $ hg debugformat -v |
|
555 | 564 | format-variant repo config default |
|
556 | 565 | fncache: yes yes yes |
|
557 | 566 | dotencode: yes yes yes |
|
558 | 567 | generaldelta: yes yes yes |
|
559 | 568 | share-safe: no no no |
|
560 | 569 | sparserevlog: yes yes yes |
|
561 | 570 | sidedata: no no no |
|
562 | 571 | persistent-nodemap: yes no no |
|
563 | 572 | copies-sdc: no no no |
|
564 | 573 | plain-cl-delta: yes yes yes |
|
565 | 574 | compression: zlib zlib zlib |
|
566 | 575 | compression-level: default default default |
|
567 | 576 | $ hg debugupgraderepo --run --no-backup --quiet |
|
568 | 577 | upgrade will perform the following actions: |
|
569 | 578 | |
|
570 | 579 | requirements |
|
571 | 580 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store |
|
572 | 581 | removed: persistent-nodemap |
|
573 | 582 | |
|
574 | 583 | processed revlogs: |
|
575 | 584 | - all-filelogs |
|
576 | 585 | - changelog |
|
577 | 586 | - manifest |
|
578 | 587 | |
|
579 | 588 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
580 | 589 | [1] |
|
581 | 590 | $ hg debugnodemap --metadata |
|
582 | 591 | |
|
583 | 592 | |
|
584 | 593 | upgrading |
|
585 | 594 | |
|
586 | 595 | $ cat << EOF >> .hg/hgrc |
|
587 | 596 | > [format] |
|
588 | 597 | > use-persistent-nodemap=yes |
|
589 | 598 | > EOF |
|
590 | 599 | $ hg debugformat -v |
|
591 | 600 | format-variant repo config default |
|
592 | 601 | fncache: yes yes yes |
|
593 | 602 | dotencode: yes yes yes |
|
594 | 603 | generaldelta: yes yes yes |
|
595 | 604 | share-safe: no no no |
|
596 | 605 | sparserevlog: yes yes yes |
|
597 | 606 | sidedata: no no no |
|
598 | 607 | persistent-nodemap: no yes no |
|
599 | 608 | copies-sdc: no no no |
|
600 | 609 | plain-cl-delta: yes yes yes |
|
601 | 610 | compression: zlib zlib zlib |
|
602 | 611 | compression-level: default default default |
|
603 | 612 | $ hg debugupgraderepo --run --no-backup --quiet |
|
604 | 613 | upgrade will perform the following actions: |
|
605 | 614 | |
|
606 | 615 | requirements |
|
607 | 616 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store |
|
608 | 617 | added: persistent-nodemap |
|
609 | 618 | |
|
610 | 619 | processed revlogs: |
|
611 | 620 | - all-filelogs |
|
612 | 621 | - changelog |
|
613 | 622 | - manifest |
|
614 | 623 | |
|
615 | 624 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
616 | 625 | 00changelog-*.nd (glob) |
|
617 | 626 | 00changelog.n |
|
618 | 627 | 00manifest-*.nd (glob) |
|
619 | 628 | 00manifest.n |
|
620 | 629 | |
|
621 | 630 | $ hg debugnodemap --metadata |
|
622 | 631 | uid: * (glob) |
|
623 | 632 | tip-rev: 5005 |
|
624 | 633 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
625 | 634 | data-length: 121088 |
|
626 | 635 | data-unused: 0 |
|
627 | 636 | data-unused: 0.000% |
|
628 | 637 | |
|
629 | 638 | Running unrelated upgrade |
|
630 | 639 | |
|
631 | 640 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all |
|
632 | 641 | upgrade will perform the following actions: |
|
633 | 642 | |
|
634 | 643 | requirements |
|
635 | 644 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store |
|
636 | 645 | |
|
637 | 646 | optimisations: re-delta-all |
|
638 | 647 | |
|
639 | 648 | processed revlogs: |
|
640 | 649 | - all-filelogs |
|
641 | 650 | - changelog |
|
642 | 651 | - manifest |
|
643 | 652 | |
|
644 | 653 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
645 | 654 | 00changelog-*.nd (glob) |
|
646 | 655 | 00changelog.n |
|
647 | 656 | 00manifest-*.nd (glob) |
|
648 | 657 | 00manifest.n |
|
649 | 658 | |
|
650 | 659 | $ hg debugnodemap --metadata |
|
651 | 660 | uid: * (glob) |
|
652 | 661 | tip-rev: 5005 |
|
653 | 662 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
654 | 663 | data-length: 121088 |
|
655 | 664 | data-unused: 0 |
|
656 | 665 | data-unused: 0.000% |
|
657 | 666 | |
|
658 | 667 | Persistent nodemap and local/streaming clone |
|
659 | 668 | ============================================ |
|
660 | 669 | |
|
661 | 670 | $ cd .. |
|
662 | 671 | |
|
663 | 672 | standard clone |
|
664 | 673 | -------------- |
|
665 | 674 | |
|
666 | 675 | The persistent nodemap should exist after a streaming clone |
|
667 | 676 | |
|
668 | 677 | $ hg clone --pull --quiet -U test-repo standard-clone |
|
669 | 678 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
670 | 679 | 00changelog-*.nd (glob) |
|
671 | 680 | 00changelog.n |
|
672 | 681 | 00manifest-*.nd (glob) |
|
673 | 682 | 00manifest.n |
|
674 | 683 | $ hg -R standard-clone debugnodemap --metadata |
|
675 | 684 | uid: * (glob) |
|
676 | 685 | tip-rev: 5005 |
|
677 | 686 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
678 | 687 | data-length: 121088 |
|
679 | 688 | data-unused: 0 |
|
680 | 689 | data-unused: 0.000% |
|
681 | 690 | |
|
682 | 691 | |
|
683 | 692 | local clone |
|
684 | 693 | ------------ |
|
685 | 694 | |
|
686 | 695 | The persistent nodemap should exist after a streaming clone |
|
687 | 696 | |
|
688 | 697 | $ hg clone -U test-repo local-clone |
|
689 | 698 | $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
690 | 699 | 00changelog-*.nd (glob) |
|
691 | 700 | 00changelog.n |
|
692 | 701 | 00manifest-*.nd (glob) |
|
693 | 702 | 00manifest.n |
|
694 | 703 | $ hg -R local-clone debugnodemap --metadata |
|
695 | 704 | uid: * (glob) |
|
696 | 705 | tip-rev: 5005 |
|
697 | 706 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
698 | 707 | data-length: 121088 |
|
699 | 708 | data-unused: 0 |
|
700 | 709 | data-unused: 0.000% |
|
701 | 710 | |
|
702 | 711 | stream clone |
|
703 | 712 | ------------ |
|
704 | 713 | |
|
705 | 714 | The persistent nodemap should exist after a streaming clone |
|
706 | 715 | |
|
707 | 716 | $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' |
|
708 | 717 | adding [s] 00manifest.n (70 bytes) |
|
709 | 718 | adding [s] 00manifest.i (313 KB) |
|
710 | 719 | adding [s] 00manifest.d (452 KB) |
|
711 | 720 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
712 | 721 | adding [s] 00changelog.n (70 bytes) |
|
713 | 722 | adding [s] 00changelog.i (313 KB) |
|
714 | 723 | adding [s] 00changelog.d (360 KB) |
|
715 | 724 | adding [s] 00changelog-*.nd (118 KB) (glob) |
|
716 | 725 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
717 | 726 | 00changelog-*.nd (glob) |
|
718 | 727 | 00changelog.n |
|
719 | 728 | 00manifest-*.nd (glob) |
|
720 | 729 | 00manifest.n |
|
721 | 730 | $ hg -R stream-clone debugnodemap --metadata |
|
722 | 731 | uid: * (glob) |
|
723 | 732 | tip-rev: 5005 |
|
724 | 733 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
725 | 734 | data-length: 121088 |
|
726 | 735 | data-unused: 0 |
|
727 | 736 | data-unused: 0.000% |
General Comments 0
You need to be logged in to leave comments.
Login now