Debian Codegraph @

tests/test-upgrade-repo.t

raw
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
3 > share =
4 > [format]
5 > # stabilize test accross variant
6 > revlog-compression=zlib
7 > [storage]
8 > dirstate-v2.slow-path=allow
9 > fileindex.slow-path=allow
10 > EOF
11
12 store and revlogv1 are required in source
13
14 $ hg --config format.usestore=false init no-store
15 $ hg -R no-store debugupgraderepo
16 abort: cannot upgrade repository; requirement missing: store
17 [255]
18
19 $ hg init no-revlogv1
20 $ cat > no-revlogv1/.hg/requires << EOF
21 > dotencode
22 > fncache
23 > generaldelta
24 > store
25 > EOF
26
27 $ hg -R no-revlogv1 debugupgraderepo
28 abort: cannot upgrade repository; missing a revlog version
29 [255]
30
31 Cannot upgrade shared repositories
32
33 $ hg init share-parent
34 $ hg -R share-parent debugbuilddag -n .+9
35 $ hg -R share-parent up tip
36 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 $ hg -q share share-parent share-child
38
39 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
40 abort: cannot use these actions on a share repository: sparserevlog
41 (upgrade the main repository directly)
42 [255]
43
44 Unless the action is compatible with share
45
46 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
47 requirements
48 preserved: * (glob)
49 added: dirstate-v2
50
51 no revlogs to process
52
53
54 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
55 upgrade will perform the following actions:
56
57 requirements
58 preserved: * (glob)
59 added: dirstate-v2
60
61 no revlogs to process
62
63 $ hg debugformat -R share-child dirstate-v2
64 format-variant repo
65 dirstate-v2: yes
66 $ hg debugformat -R share-parent dirstate-v2
67 format-variant repo
68 dirstate-v2: no
69 $ hg status --all -R share-child
70 C nf0
71 C nf1
72 C nf2
73 C nf3
74 C nf4
75 C nf5
76 C nf6
77 C nf7
78 C nf8
79 C nf9
80 $ hg log -l 3 -R share-child
81 changeset: 9:0059eb38e4a4
82 tag: tip
83 user: debugbuilddag
84 date: Thu Jan 01 00:00:09 1970 +0000
85 summary: r9
86
87 changeset: 8:4d5be70c8130
88 user: debugbuilddag
89 date: Thu Jan 01 00:00:08 1970 +0000
90 summary: r8
91
92 changeset: 7:e60bfe72517e
93 user: debugbuilddag
94 date: Thu Jan 01 00:00:07 1970 +0000
95 summary: r7
96
97 $ hg status --all -R share-parent
98 C nf0
99 C nf1
100 C nf2
101 C nf3
102 C nf4
103 C nf5
104 C nf6
105 C nf7
106 C nf8
107 C nf9
108 $ hg log -l 3 -R share-parent
109 changeset: 9:0059eb38e4a4
110 tag: tip
111 user: debugbuilddag
112 date: Thu Jan 01 00:00:09 1970 +0000
113 summary: r9
114
115 changeset: 8:4d5be70c8130
116 user: debugbuilddag
117 date: Thu Jan 01 00:00:08 1970 +0000
118 summary: r8
119
120 changeset: 7:e60bfe72517e
121 user: debugbuilddag
122 date: Thu Jan 01 00:00:07 1970 +0000
123 summary: r7
124
125
126 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
127 upgrade will perform the following actions:
128
129 requirements
130 preserved: * (glob)
131 removed: dirstate-v2
132
133 no revlogs to process
134
135 $ hg debugformat -R share-child dirstate-v2
136 format-variant repo
137 dirstate-v2: no
138 $ hg debugformat -R share-parent dirstate-v2
139 format-variant repo
140 dirstate-v2: no
141 $ hg status --all -R share-child
142 C nf0
143 C nf1
144 C nf2
145 C nf3
146 C nf4
147 C nf5
148 C nf6
149 C nf7
150 C nf8
151 C nf9
152 $ hg log -l 3 -R share-child
153 changeset: 9:0059eb38e4a4
154 tag: tip
155 user: debugbuilddag
156 date: Thu Jan 01 00:00:09 1970 +0000
157 summary: r9
158
159 changeset: 8:4d5be70c8130
160 user: debugbuilddag
161 date: Thu Jan 01 00:00:08 1970 +0000
162 summary: r8
163
164 changeset: 7:e60bfe72517e
165 user: debugbuilddag
166 date: Thu Jan 01 00:00:07 1970 +0000
167 summary: r7
168
169 $ hg status --all -R share-parent
170 C nf0
171 C nf1
172 C nf2
173 C nf3
174 C nf4
175 C nf5
176 C nf6
177 C nf7
178 C nf8
179 C nf9
180 $ hg log -l 3 -R share-parent
181 changeset: 9:0059eb38e4a4
182 tag: tip
183 user: debugbuilddag
184 date: Thu Jan 01 00:00:09 1970 +0000
185 summary: r9
186
187 changeset: 8:4d5be70c8130
188 user: debugbuilddag
189 date: Thu Jan 01 00:00:08 1970 +0000
190 summary: r8
191
192 changeset: 7:e60bfe72517e
193 user: debugbuilddag
194 date: Thu Jan 01 00:00:07 1970 +0000
195 summary: r7
196
197
198 Do not yet support downgrading treemanifest repos
199
200 $ hg --config experimental.treemanifest=true init treemanifest
201 $ hg -R treemanifest debugupgraderepo
202 abort: cannot upgrade repository; requirement would be removed: treemanifest
203 [255]
204
205 Cannot add treemanifest requirement during upgrade
206
207 $ hg init disallowaddedreq
208 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
209 abort: cannot upgrade repository; do not support adding requirement: treemanifest
210 [255]
211
212 An upgrade of a repository created with recommended settings only suggests optimizations
213
214 $ hg init empty
215 $ cd empty
216 $ hg debugformat
217 format-variant repo
218 fncache: yes
219 fileindex-v1: no
220 dirstate-v2: no
221 tracked-hint: no
222 dotencode: yes
223 fragile-plain-encode: no
224 generaldelta: yes
225 share-safe: yes
226 sparserevlog: yes
227 delta-info-flags: no
228 persistent-nodemap: no (no-rust !)
229 persistent-nodemap: yes (rust !)
230 copies-sdc: no
231 revlog-v2: no
232 changelog-v2: no
233 plain-cl-delta: yes
234 compression: zlib
235 compression-level: default
236 $ hg debugformat --verbose
237 format-variant repo config default
238 fncache: yes yes yes
239 fileindex-v1: no no no
240 dirstate-v2: no no no
241 tracked-hint: no no no
242 dotencode: yes yes yes
243 fragile-plain-encode: no no no
244 generaldelta: yes yes yes
245 share-safe: yes yes yes
246 sparserevlog: yes yes yes
247 delta-info-flags: no no no
248 persistent-nodemap: no no no (no-rust !)
249 persistent-nodemap: yes yes no (rust !)
250 copies-sdc: no no no
251 revlog-v2: no no no
252 changelog-v2: no no no
253 plain-cl-delta: yes yes yes
254 compression: zlib zlib zlib (no-zstd !)
255 compression: zlib zlib zstd (zstd !)
256 compression-level: default default default
257 $ hg debugformat --verbose --config format.usefncache=no
258 format-variant repo config default
259 fncache: yes no yes
260 fileindex-v1: no no no
261 dirstate-v2: no no no
262 tracked-hint: no no no
263 dotencode: yes no yes
264 fragile-plain-encode: no no no
265 generaldelta: yes yes yes
266 share-safe: yes yes yes
267 sparserevlog: yes yes yes
268 delta-info-flags: no no no
269 persistent-nodemap: no no no (no-rust !)
270 persistent-nodemap: yes yes no (rust !)
271 copies-sdc: no no no
272 revlog-v2: no no no
273 changelog-v2: no no no
274 plain-cl-delta: yes yes yes
275 compression: zlib zlib zlib (no-zstd !)
276 compression: zlib zlib zstd (zstd !)
277 compression-level: default default default
278 $ hg debugformat --verbose --config format.usefncache=no --color=debug
279 format-variant repo config default
280 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
281 [formatvariant.name.uptodate|fileindex-v1: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
282 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
283 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
284 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
285 [formatvariant.name.uptodate|fragile-plain-encode: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
286 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
287 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
288 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
289 [formatvariant.name.uptodate|delta-info-flags: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
290 [formatvariant.name.uptodate|persistent-nodemap: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
291 [formatvariant.name.mismatchdefault|persistent-nodemap: ][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
292 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
293 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
294 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
295 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
296 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
297 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
298 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
299 $ hg debugformat -Tjson
300 [
301 {
302 "config": true,
303 "default": true,
304 "name": "fncache",
305 "repo": true
306 },
307 {
308 "config": false,
309 "default": false,
310 "name": "fileindex-v1",
311 "repo": false
312 },
313 {
314 "config": false,
315 "default": false,
316 "name": "dirstate-v2",
317 "repo": false
318 },
319 {
320 "config": false,
321 "default": false,
322 "name": "tracked-hint",
323 "repo": false
324 },
325 {
326 "config": true,
327 "default": true,
328 "name": "dotencode",
329 "repo": true
330 },
331 {
332 "config": false,
333 "default": false,
334 "name": "fragile-plain-encode",
335 "repo": false
336 },
337 {
338 "config": true,
339 "default": true,
340 "name": "generaldelta",
341 "repo": true
342 },
343 {
344 "config": true,
345 "default": true,
346 "name": "share-safe",
347 "repo": true
348 },
349 {
350 "config": true,
351 "default": true,
352 "name": "sparserevlog",
353 "repo": true
354 },
355 {
356 "config": false,
357 "default": false,
358 "name": "delta-info-flags",
359 "repo": false
360 },
361 {
362 "config": false, (no-rust !)
363 "config": true, (rust !)
364 "default": false,
365 "name": "persistent-nodemap",
366 "repo": false (no-rust !)
367 "repo": true (rust !)
368 },
369 {
370 "config": false,
371 "default": false,
372 "name": "copies-sdc",
373 "repo": false
374 },
375 {
376 "config": false,
377 "default": false,
378 "name": "revlog-v2",
379 "repo": false
380 },
381 {
382 "config": false,
383 "default": false,
384 "name": "changelog-v2",
385 "repo": false
386 },
387 {
388 "config": true,
389 "default": true,
390 "name": "plain-cl-delta",
391 "repo": true
392 },
393 {
394 "config": "zlib",
395 "default": "zlib", (no-zstd !)
396 "default": "zstd", (zstd !)
397 "name": "compression",
398 "repo": "zlib"
399 },
400 {
401 "config": "default",
402 "default": "default",
403 "name": "compression-level",
404 "repo": "default"
405 }
406 ]
407 $ hg debugupgraderepo
408 (no format upgrades found in existing repository)
409 performing an upgrade with "--run" will make the following changes:
410
411 requirements
412 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
413 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
414
415 no revlogs to process
416
417 additional optimizations are available by specifying "--optimize <name>":
418
419 re-delta-quick
420 deltas within internal storage will be reprocessed with minimal overhead, deltas already in store will be reused as often as possible. This provides a way to smooth out potential problematic deltas while avoiding deeper but slower optimization that might not be necessary
421
422 re-delta-parent
423 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
424
425 re-delta-multibase
426 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
427
428 re-delta-all
429 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
430
431 re-delta-fulladd
432 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
433
434
435 $ hg debugupgraderepo --quiet
436 requirements
437 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
438 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
439
440 no revlogs to process
441
442
443 --optimize can be used to add optimizations
444
445 $ hg debugupgrade --optimize 're-delta-parent'
446 (no format upgrades found in existing repository)
447 performing an upgrade with "--run" will make the following changes:
448
449 requirements
450 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
451 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
452
453 optimisations: re-delta-parent
454
455 re-delta-parent
456 deltas within internal storage will choose a new base revision if needed
457
458 processed revlogs:
459 - all-filelogs
460 - changelog
461 - manifest
462
463 additional optimizations are available by specifying "--optimize <name>":
464
465 re-delta-quick
466 deltas within internal storage will be reprocessed with minimal overhead, deltas already in store will be reused as often as possible. This provides a way to smooth out potential problematic deltas while avoiding deeper but slower optimization that might not be necessary
467
468 re-delta-multibase
469 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
470
471 re-delta-all
472 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
473
474 re-delta-fulladd
475 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
476
477
478 modern form of the option
479
480 $ hg debugupgrade --optimize re-delta-parent
481 (no format upgrades found in existing repository)
482 performing an upgrade with "--run" will make the following changes:
483
484 requirements
485 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
486 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
487
488 optimisations: re-delta-parent
489
490 re-delta-parent
491 deltas within internal storage will choose a new base revision if needed
492
493 processed revlogs:
494 - all-filelogs
495 - changelog
496 - manifest
497
498 additional optimizations are available by specifying "--optimize <name>":
499
500 re-delta-quick
501 deltas within internal storage will be reprocessed with minimal overhead, deltas already in store will be reused as often as possible. This provides a way to smooth out potential problematic deltas while avoiding deeper but slower optimization that might not be necessary
502
503 re-delta-multibase
504 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
505
506 re-delta-all
507 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
508
509 re-delta-fulladd
510 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
511
512
513 $ hg debugupgrade --optimize re-delta-parent --quiet
514 requirements
515 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
516 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
517
518 optimisations: re-delta-parent
519
520 processed revlogs:
521 - all-filelogs
522 - changelog
523 - manifest
524
525
526 passing multiple optimization:
527
528 $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet
529 requirements
530 preserved: * (glob)
531
532 optimisations: re-delta-multibase, re-delta-parent
533
534 processed revlogs:
535 - all-filelogs
536 - changelog
537 - manifest
538
539
540 unknown optimization:
541
542 $ hg debugupgrade --optimize foobar
543 abort: unknown optimization action requested: foobar
544 (run without arguments to see valid optimizations)
545 [255]
546
547 Various sub-optimal detections work
548
549 $ cat > .hg/requires << EOF
550 > revlogv1
551 > store
552 > EOF
553
554 $ hg debugformat
555 format-variant repo
556 fncache: no
557 fileindex-v1: no
558 dirstate-v2: no
559 tracked-hint: no
560 dotencode: no
561 fragile-plain-encode: no
562 generaldelta: no
563 share-safe: no
564 sparserevlog: no
565 delta-info-flags: no
566 persistent-nodemap: no
567 copies-sdc: no
568 revlog-v2: no
569 changelog-v2: no
570 plain-cl-delta: yes
571 compression: zlib
572 compression-level: default
573 $ hg debugformat --verbose
574 format-variant repo config default
575 fncache: no yes yes
576 fileindex-v1: no no no
577 dirstate-v2: no no no
578 tracked-hint: no no no
579 dotencode: no yes yes
580 fragile-plain-encode: no no no
581 generaldelta: no yes yes
582 share-safe: no yes yes
583 sparserevlog: no yes yes
584 delta-info-flags: no no no
585 persistent-nodemap: no no no (no-rust !)
586 persistent-nodemap: no yes no (rust !)
587 copies-sdc: no no no
588 revlog-v2: no no no
589 changelog-v2: no no no
590 plain-cl-delta: yes yes yes
591 compression: zlib zlib zlib (no-zstd !)
592 compression: zlib zlib zstd (zstd !)
593 compression-level: default default default
594 $ hg debugformat --verbose --config format.usegeneraldelta=no
595 format-variant repo config default
596 fncache: no yes yes
597 fileindex-v1: no no no
598 dirstate-v2: no no no
599 tracked-hint: no no no
600 dotencode: no yes yes
601 fragile-plain-encode: no no no
602 generaldelta: no no yes
603 share-safe: no yes yes
604 sparserevlog: no no yes
605 delta-info-flags: no no no
606 persistent-nodemap: no no no (no-rust !)
607 persistent-nodemap: no yes no (rust !)
608 copies-sdc: no no no
609 revlog-v2: no no no
610 changelog-v2: no no no
611 plain-cl-delta: yes yes yes
612 compression: zlib zlib zlib (no-zstd !)
613 compression: zlib zlib zstd (zstd !)
614 compression-level: default default default
615 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
616 format-variant repo config default
617 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
618 [formatvariant.name.uptodate|fileindex-v1: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
619 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
620 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
621 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
622 [formatvariant.name.uptodate|fragile-plain-encode: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
623 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
624 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
625 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
626 [formatvariant.name.uptodate|delta-info-flags: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
627 [formatvariant.name.uptodate|persistent-nodemap: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
628 [formatvariant.name.mismatchconfig|persistent-nodemap: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
629 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
630 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
631 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
632 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
633 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
634 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
635 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
636 $ hg debugupgraderepo
637 note: selecting all-filelogs for processing to change: dotencode
638 note: selecting all-manifestlogs for processing to change: fncache
639 note: selecting changelog for processing to change: fncache
640
641 repository lacks features recommended by current config options:
642
643 fncache
644 long and reserved filenames may not work correctly; repository performance is sub-optimal
645
646 dotencode
647 storage of filenames beginning with a period or space may not work correctly
648
649 generaldelta
650 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
651
652 share-safe
653 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
654
655 sparserevlog
656 in order to limit disk reading and memory usage on older versions, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severely limit Mercurial's ability to build a good chain of delta resulting in much more storage space being taken, and limit reusability of on disk delta during exchange.
657
658 persistent-nodemap (rust !)
659 persist the node -> rev mapping on disk to speedup lookup (rust !)
660 (rust !)
661
662 performing an upgrade with "--run" will make the following changes:
663
664 requirements
665 preserved: revlogv1, store
666 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
667 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
668
669 fncache
670 repository will be more resilient to storing certain paths and performance of certain operations should be improved
671
672 dotencode
673 repository will be better able to store files beginning with a space or period
674
675 generaldelta
676 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
677
678 share-safe
679 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
680
681 sparserevlog
682 Revlog supports delta chain with more unused data between payloads. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with the server.
683
684 persistent-nodemap (rust !)
685 Speedup revision lookup by node id. (rust !)
686 (rust !)
687 processed revlogs:
688 - all-filelogs
689 - changelog
690 - manifest
691
692 additional optimizations are available by specifying "--optimize <name>":
693
694 re-delta-quick
695 deltas within internal storage will be reprocessed with minimal overhead, deltas already in store will be reused as often as possible. This provides a way to smooth out potential problematic deltas while avoiding deeper but slower optimization that might not be necessary
696
697 re-delta-parent
698 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
699
700 re-delta-multibase
701 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
702
703 re-delta-all
704 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
705
706 re-delta-fulladd
707 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
708
709
710 Check that disabling general-delta also disable sparse-revlog
711 (unless sparse-revlog is explicitly enabled in which case general-delta is forcily enabled)
712
713 $ hg debugformat --verbose generaldelta sparserevlog \
714 > --config format.usegeneraldelta=no
715 format-variant repo config default
716 generaldelta: no no yes
717 sparserevlog: no no yes
718 $ hg debugformat --verbose generaldelta sparserevlog \
719 > --config format.usegeneraldelta=no \
720 > --config format.sparse-revlog=no
721 format-variant repo config default
722 generaldelta: no no yes
723 sparserevlog: no no yes
724 $ hg debugformat --verbose generaldelta sparserevlog \
725 > --config format.usegeneraldelta=no \
726 > --config format.sparse-revlog=yes
727 format-variant repo config default
728 generaldelta: no yes yes
729 sparserevlog: no yes yes
730
731 $ hg debugupgraderepo --quiet
732 requirements
733 preserved: revlogv1, store
734 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
735 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
736
737 processed revlogs:
738 - all-filelogs
739 - changelog
740 - manifest
741
742
743 $ hg --config format.dotencode=false debugupgraderepo
744 note: selecting all-filelogs for processing to change: fncache
745 note: selecting all-manifestlogs for processing to change: fncache
746 note: selecting changelog for processing to change: fncache
747
748 repository lacks features recommended by current config options:
749
750 fncache
751 long and reserved filenames may not work correctly; repository performance is sub-optimal
752
753 generaldelta
754 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
755
756 share-safe
757 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
758
759 sparserevlog
760 in order to limit disk reading and memory usage on older versions, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severely limit Mercurial's ability to build a good chain of delta resulting in much more storage space being taken, and limit reusability of on disk delta during exchange.
761
762 persistent-nodemap (rust !)
763 persist the node -> rev mapping on disk to speedup lookup (rust !)
764 (rust !)
765 repository lacks features used by the default config options:
766
767 dotencode
768 storage of filenames beginning with a period or space may not work correctly
769
770
771 performing an upgrade with "--run" will make the following changes:
772
773 requirements
774 preserved: revlogv1, store
775 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
776 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
777
778 fncache
779 repository will be more resilient to storing certain paths and performance of certain operations should be improved
780
781 generaldelta
782 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
783
784 share-safe
785 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
786
787 sparserevlog
788 Revlog supports delta chain with more unused data between payloads. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with the server.
789
790 persistent-nodemap (rust !)
791 Speedup revision lookup by node id. (rust !)
792 (rust !)
793 processed revlogs:
794 - all-filelogs
795 - changelog
796 - manifest
797
798 additional optimizations are available by specifying "--optimize <name>":
799
800 re-delta-quick
801 deltas within internal storage will be reprocessed with minimal overhead, deltas already in store will be reused as often as possible. This provides a way to smooth out potential problematic deltas while avoiding deeper but slower optimization that might not be necessary
802
803 re-delta-parent
804 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
805
806 re-delta-multibase
807 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
808
809 re-delta-all
810 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
811
812 re-delta-fulladd
813 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
814
815
816 $ cd ..
817
818 Upgrading a repository that is already modern essentially no-ops
819
820 $ hg init modern
821 $ hg -R modern debugupgraderepo --run
822 nothing to do
823
824 Upgrading a repository to generaldelta works
825
826 $ hg --config format.usegeneraldelta=false init upgradegd
827 $ cd upgradegd
828 $ touch f0
829 $ hg -q commit -A -m initial
830 $ mkdir FooBarDirectory.d
831 $ touch FooBarDirectory.d/f1
832 $ hg -q commit -A -m 'add f1'
833 $ hg -q up -r 0
834 >>> import random
835 >>> random.seed(0) # have a reproducible content
836 >>> with open("f2", "wb") as f:
837 ... for i in range(100000):
838 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
839 $ hg -q commit -A -m 'add f2'
840
841 make sure we have a .d file
842
843 $ ls -d .hg/store/data/*
844 .hg/store/data/_foo_bar_directory.d.hg
845 .hg/store/data/f0.i
846 .hg/store/data/f2.d
847 .hg/store/data/f2.i
848
849 $ hg debugupgraderepo --run --config format.sparse-revlog=false
850 note: selecting all-filelogs for processing to change: generaldelta
851 note: selecting all-manifestlogs for processing to change: generaldelta
852 note: selecting changelog for processing to change: generaldelta
853
854 upgrade will perform the following actions:
855
856 requirements
857 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
858 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
859 added: generaldelta
860
861 generaldelta
862 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
863
864 processed revlogs:
865 - all-filelogs
866 - changelog
867 - manifest
868
869 beginning upgrade...
870 repository locked and read-only
871 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
872 (it is safe to interrupt this process any time before data migration completes)
873 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
874 migrating 519 KB in store; 1.05 MB tracked data
875 migrating filelogs:
876 revlog-count: 3
877 total-revisions: 3
878 store-size: 518 KB
879 tracked-size: 1.05 MB
880 size-change: 0 bytes
881 elapsed-time: [0-9 ]{9} seconds (re)
882 migrating manifest:
883 filelog-count: 1
884 total-revisions: 3
885 store-size: 384 bytes
886 tracked-size: 238 bytes
887 size-change: -17 bytes
888 elapsed-time: [0-9 ]{9} seconds (re)
889 migrating changelog:
890 total-revisions: 3
891 store-size: 394 bytes
892 tracked-size: 199 bytes
893 size-change: 0 bytes
894 elapsed-time: [0-9 ]{9} seconds (re)
895 finished migrating:
896 total-revlog : 5
897 total-revisions: 9
898 size-change: 0 bytes
899 elapsed-time: [0-9 ]{9} seconds (re)
900 copying phaseroots
901 copying requires
902 data fully upgraded in a temporary repository
903 marking source repository as being upgraded; clients will be unable to read from repository
904 starting in-place swap of repository data
905 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
906 replacing store...
907 store replacement complete; repository was inconsistent for *s (glob)
908 finalizing requirements file and making repository readable again
909 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
910 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
911 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
912
913 Original requirements backed up
914
915 $ cat .hg/upgradebackup.*/requires
916 share-safe
917 $ cat .hg/upgradebackup.*/store/requires
918 dotencode
919 fncache
920 persistent-nodemap (rust !)
921 revlogv1
922 store
923 upgradeinprogress
924
925 generaldelta added to original requirements files
926
927 $ hg debugrequires
928 dotencode
929 fncache
930 generaldelta
931 persistent-nodemap (rust !)
932 revlogv1
933 share-safe
934 store
935
936 store directory has files we expect
937
938 $ ls .hg/store
939 00changelog-????????.nd (glob) (rust !)
940 00changelog.d
941 00changelog.i
942 00changelog.n (rust !)
943 00manifest.i
944 data
945 data-s
946 fncache
947 phaseroots
948 requires
949 undo
950 undo.backupfiles
951
952 manifest should be generaldelta
953
954 $ hg debugrevlog -m | grep flags
955 flags : inline, generaldelta
956
957 verify should be happy
958
959 $ hg verify -q
960
961 old store should be backed up
962
963 $ ls -d .hg/upgradebackup.*/
964 .hg/upgradebackup.*/ (glob)
965 $ ls .hg/upgradebackup.*/store
966 00changelog-????????.nd (glob) (rust !)
967 00changelog.d
968 00changelog.i
969 00changelog.n (rust !)
970 00manifest.i
971 data
972 data-s
973 fncache
974 phaseroots
975 requires
976 undo
977 undo.backup.00changelog.n.bck (rust !)
978 undo.backup.fncache.bck
979 undo.backupfiles
980
981 unless --no-backup is passed
982
983 $ rm -rf .hg/upgradebackup.*/
984 $ hg debugupgraderepo --run --no-backup
985 note: selecting all-filelogs for processing to change: sparserevlog
986 note: selecting all-manifestlogs for processing to change: sparserevlog
987 note: selecting changelog for processing to change: sparserevlog
988
989 upgrade will perform the following actions:
990
991 requirements
992 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
993 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
994 added: sparserevlog
995
996 sparserevlog
997 Revlog supports delta chain with more unused data between payloads. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with the server.
998
999 processed revlogs:
1000 - all-filelogs
1001 - changelog
1002 - manifest
1003
1004 beginning upgrade...
1005 repository locked and read-only
1006 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1007 (it is safe to interrupt this process any time before data migration completes)
1008 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1009 migrating 519 KB in store; 1.05 MB tracked data
1010 migrating filelogs:
1011 revlog-count: 3
1012 total-revisions: 3
1013 store-size: 518 KB
1014 tracked-size: 1.05 MB
1015 size-change: 0 bytes
1016 elapsed-time: [0-9 ]{9} seconds (re)
1017 migrating manifest:
1018 filelog-count: 1
1019 total-revisions: 3
1020 store-size: 367 bytes
1021 tracked-size: 238 bytes
1022 size-change: 0 bytes
1023 elapsed-time: [0-9 ]{9} seconds (re)
1024 migrating changelog:
1025 total-revisions: 3
1026 store-size: 394 bytes
1027 tracked-size: 199 bytes
1028 size-change: 0 bytes
1029 elapsed-time: [0-9 ]{9} seconds (re)
1030 finished migrating:
1031 total-revlog : 5
1032 total-revisions: 9
1033 size-change: 0 bytes
1034 elapsed-time: [0-9 ]{9} seconds (re)
1035 copying phaseroots
1036 copying requires
1037 data fully upgraded in a temporary repository
1038 marking source repository as being upgraded; clients will be unable to read from repository
1039 starting in-place swap of repository data
1040 replacing store...
1041 store replacement complete; repository was inconsistent for * (glob)
1042 finalizing requirements file and making repository readable again
1043 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1044 $ ls -1 .hg/ | grep upgradebackup
1045 [1]
1046
1047 We can restrict optimization to some revlog:
1048
1049 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1050 upgrade will perform the following actions:
1051
1052 requirements
1053 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1054 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1055
1056 optimisations: re-delta-parent
1057
1058 re-delta-parent
1059 deltas within internal storage will choose a new base revision if needed
1060
1061 processed revlogs:
1062 - manifest
1063
1064 beginning upgrade...
1065 repository locked and read-only
1066 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1067 (it is safe to interrupt this process any time before data migration completes)
1068 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1069 migrating 519 KB in store; 1.05 MB tracked data
1070 migrating filelogs:
1071 revlog-count: 3
1072 total-revisions: 3
1073 store-size: 518 KB
1074 tracked-size: 1.05 MB
1075 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1076 blindly copying data/f0.i containing 1 revisions
1077 blindly copying data/f2.i containing 1 revisions
1078 size-change: 0 bytes
1079 elapsed-time: [0-9 ]{9} seconds (re)
1080 migrating manifest:
1081 filelog-count: 1
1082 total-revisions: 3
1083 store-size: 367 bytes
1084 tracked-size: 238 bytes
1085 cloning 3 revisions from 00manifest.i
1086 size-change: 0 bytes
1087 elapsed-time: [0-9 ]{9} seconds (re)
1088 migrating changelog:
1089 total-revisions: 3
1090 store-size: 394 bytes
1091 tracked-size: 199 bytes
1092 blindly copying 00changelog.i containing 3 revisions
1093 size-change: 0 bytes
1094 elapsed-time: [0-9 ]{9} seconds (re)
1095 finished migrating:
1096 total-revlog : 5
1097 total-revisions: 9
1098 size-change: 0 bytes
1099 elapsed-time: [0-9 ]{9} seconds (re)
1100 copying phaseroots
1101 copying requires
1102 data fully upgraded in a temporary repository
1103 marking source repository as being upgraded; clients will be unable to read from repository
1104 starting in-place swap of repository data
1105 replacing store...
1106 store replacement complete; repository was inconsistent for *s (glob)
1107 finalizing requirements file and making repository readable again
1108 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1109
1110 Check that the repo still works fine
1111
1112 $ hg log -G --stat
1113 @ changeset: 2:fca376863211
1114 | tag: tip
1115 | parent: 0:ba592bf28da2
1116 | user: test
1117 | date: Thu Jan 01 00:00:00 1970 +0000
1118 | summary: add f2
1119 |
1120 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1121 | 1 files changed, 100000 insertions(+), 0 deletions(-)
1122 |
1123 | o changeset: 1:2029ce2354e2
1124 |/ user: test
1125 | date: Thu Jan 01 00:00:00 1970 +0000
1126 | summary: add f1
1127 |
1128 |
1129 o changeset: 0:ba592bf28da2
1130 user: test
1131 date: Thu Jan 01 00:00:00 1970 +0000
1132 summary: initial
1133
1134
1135
1136 $ hg verify -q
1137
1138 Check we can select negatively
1139
1140 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
1141 upgrade will perform the following actions:
1142
1143 requirements
1144 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1145 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1146
1147 optimisations: re-delta-parent
1148
1149 re-delta-parent
1150 deltas within internal storage will choose a new base revision if needed
1151
1152 processed revlogs:
1153 - all-filelogs
1154 - changelog
1155
1156 beginning upgrade...
1157 repository locked and read-only
1158 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1159 (it is safe to interrupt this process any time before data migration completes)
1160 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1161 migrating 519 KB in store; 1.05 MB tracked data
1162 migrating filelogs:
1163 revlog-count: 3
1164 total-revisions: 3
1165 store-size: 518 KB
1166 tracked-size: 1.05 MB
1167 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1168 cloning 1 revisions from data/f0.i
1169 cloning 1 revisions from data/f2.i
1170 size-change: 0 bytes
1171 elapsed-time: [0-9 ]{9} seconds (re)
1172 migrating manifest:
1173 filelog-count: 1
1174 total-revisions: 3
1175 store-size: 367 bytes
1176 tracked-size: 238 bytes
1177 blindly copying 00manifest.i containing 3 revisions
1178 size-change: 0 bytes
1179 elapsed-time: [0-9 ]{9} seconds (re)
1180 migrating changelog:
1181 total-revisions: 3
1182 store-size: 394 bytes
1183 tracked-size: 199 bytes
1184 cloning 3 revisions from 00changelog.i
1185 size-change: 0 bytes
1186 elapsed-time: [0-9 ]{9} seconds (re)
1187 finished migrating:
1188 total-revlog : 5
1189 total-revisions: 9
1190 size-change: 0 bytes
1191 elapsed-time: [0-9 ]{9} seconds (re)
1192 copying phaseroots
1193 copying requires
1194 data fully upgraded in a temporary repository
1195 marking source repository as being upgraded; clients will be unable to read from repository
1196 starting in-place swap of repository data
1197 replacing store...
1198 store replacement complete; repository was inconsistent for *s (glob)
1199 finalizing requirements file and making repository readable again
1200 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1201 $ hg verify -q
1202
1203 Check that we can select changelog only
1204
1205 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1206 upgrade will perform the following actions:
1207
1208 requirements
1209 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1210 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1211
1212 optimisations: re-delta-parent
1213
1214 re-delta-parent
1215 deltas within internal storage will choose a new base revision if needed
1216
1217 processed revlogs:
1218 - changelog
1219
1220 beginning upgrade...
1221 repository locked and read-only
1222 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1223 (it is safe to interrupt this process any time before data migration completes)
1224 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1225 migrating 519 KB in store; 1.05 MB tracked data
1226 migrating filelogs:
1227 revlog-count: 3
1228 total-revisions: 3
1229 store-size: 518 KB
1230 tracked-size: 1.05 MB
1231 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1232 blindly copying data/f0.i containing 1 revisions
1233 blindly copying data/f2.i containing 1 revisions
1234 size-change: 0 bytes
1235 elapsed-time: [0-9 ]{9} seconds (re)
1236 migrating manifest:
1237 filelog-count: 1
1238 total-revisions: 3
1239 store-size: 367 bytes
1240 tracked-size: 238 bytes
1241 blindly copying 00manifest.i containing 3 revisions
1242 size-change: 0 bytes
1243 elapsed-time: [0-9 ]{9} seconds (re)
1244 migrating changelog:
1245 total-revisions: 3
1246 store-size: 394 bytes
1247 tracked-size: 199 bytes
1248 cloning 3 revisions from 00changelog.i
1249 size-change: 0 bytes
1250 elapsed-time: [0-9 ]{9} seconds (re)
1251 finished migrating:
1252 total-revlog : 5
1253 total-revisions: 9
1254 size-change: 0 bytes
1255 elapsed-time: [0-9 ]{9} seconds (re)
1256 copying phaseroots
1257 copying requires
1258 data fully upgraded in a temporary repository
1259 marking source repository as being upgraded; clients will be unable to read from repository
1260 starting in-place swap of repository data
1261 replacing store...
1262 store replacement complete; repository was inconsistent for *s (glob)
1263 finalizing requirements file and making repository readable again
1264 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1265 $ hg verify -q
1266
1267 Check that we can select filelog only
1268
1269 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1270 upgrade will perform the following actions:
1271
1272 requirements
1273 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1274 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1275
1276 optimisations: re-delta-parent
1277
1278 re-delta-parent
1279 deltas within internal storage will choose a new base revision if needed
1280
1281 processed revlogs:
1282 - all-filelogs
1283
1284 beginning upgrade...
1285 repository locked and read-only
1286 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1287 (it is safe to interrupt this process any time before data migration completes)
1288 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1289 migrating 519 KB in store; 1.05 MB tracked data
1290 migrating filelogs:
1291 revlog-count: 3
1292 total-revisions: 3
1293 store-size: 518 KB
1294 tracked-size: 1.05 MB
1295 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1296 cloning 1 revisions from data/f0.i
1297 cloning 1 revisions from data/f2.i
1298 size-change: 0 bytes
1299 elapsed-time: [0-9 ]{9} seconds (re)
1300 migrating manifest:
1301 filelog-count: 1
1302 total-revisions: 3
1303 store-size: 367 bytes
1304 tracked-size: 238 bytes
1305 blindly copying 00manifest.i containing 3 revisions
1306 size-change: 0 bytes
1307 elapsed-time: [0-9 ]{9} seconds (re)
1308 migrating changelog:
1309 total-revisions: 3
1310 store-size: 394 bytes
1311 tracked-size: 199 bytes
1312 blindly copying 00changelog.i containing 3 revisions
1313 size-change: 0 bytes
1314 elapsed-time: [0-9 ]{9} seconds (re)
1315 finished migrating:
1316 total-revlog : 5
1317 total-revisions: 9
1318 size-change: 0 bytes
1319 elapsed-time: [0-9 ]{9} seconds (re)
1320 copying phaseroots
1321 copying requires
1322 data fully upgraded in a temporary repository
1323 marking source repository as being upgraded; clients will be unable to read from repository
1324 starting in-place swap of repository data
1325 replacing store...
1326 store replacement complete; repository was inconsistent for *s (glob)
1327 finalizing requirements file and making repository readable again
1328 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1329 $ hg verify -q
1330
1331
1332 Check you can't skip revlog clone during important format downgrade
1333
1334 $ echo "[format]" > .hg/hgrc
1335 $ echo "sparse-revlog=no" >> .hg/hgrc
1336 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1337 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1338
1339 requirements
1340 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1341 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1342 removed: sparserevlog
1343
1344 optimisations: re-delta-parent
1345
1346 processed revlogs:
1347 - all-filelogs
1348 - changelog
1349 - manifest
1350
1351 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1352 note: selecting all-filelogs for processing to change: sparserevlog
1353 note: selecting changelog for processing to change: sparserevlog
1354
1355 upgrade will perform the following actions:
1356
1357 requirements
1358 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1359 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1360 removed: sparserevlog
1361
1362 optimisations: re-delta-parent
1363
1364 re-delta-parent
1365 deltas within internal storage will choose a new base revision if needed
1366
1367 processed revlogs:
1368 - all-filelogs
1369 - changelog
1370 - manifest
1371
1372 beginning upgrade...
1373 repository locked and read-only
1374 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1375 (it is safe to interrupt this process any time before data migration completes)
1376 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1377 migrating 519 KB in store; 1.05 MB tracked data
1378 migrating filelogs:
1379 revlog-count: 3
1380 total-revisions: 3
1381 store-size: 518 KB
1382 tracked-size: 1.05 MB
1383 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1384 cloning 1 revisions from data/f0.i
1385 cloning 1 revisions from data/f2.i
1386 size-change: 0 bytes
1387 elapsed-time: [0-9 ]{9} seconds (re)
1388 migrating manifest:
1389 filelog-count: 1
1390 total-revisions: 3
1391 store-size: 367 bytes
1392 tracked-size: 238 bytes
1393 cloning 3 revisions from 00manifest.i
1394 size-change: 0 bytes
1395 elapsed-time: [0-9 ]{9} seconds (re)
1396 migrating changelog:
1397 total-revisions: 3
1398 store-size: 394 bytes
1399 tracked-size: 199 bytes
1400 cloning 3 revisions from 00changelog.i
1401 size-change: 0 bytes
1402 elapsed-time: [0-9 ]{9} seconds (re)
1403 finished migrating:
1404 total-revlog : 5
1405 total-revisions: 9
1406 size-change: 0 bytes
1407 elapsed-time: [0-9 ]{9} seconds (re)
1408 copying phaseroots
1409 copying requires
1410 data fully upgraded in a temporary repository
1411 marking source repository as being upgraded; clients will be unable to read from repository
1412 starting in-place swap of repository data
1413 replacing store...
1414 store replacement complete; repository was inconsistent for *s (glob)
1415 finalizing requirements file and making repository readable again
1416 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1417 $ hg verify -q
1418
1419 Check you can't skip revlog clone during important format upgrade
1420
1421 $ echo "sparse-revlog=yes" >> .hg/hgrc
1422 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1423 note: selecting all-filelogs for processing to change: sparserevlog
1424 note: selecting changelog for processing to change: sparserevlog
1425
1426 upgrade will perform the following actions:
1427
1428 requirements
1429 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1430 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1431 added: sparserevlog
1432
1433 optimisations: re-delta-parent
1434
1435 sparserevlog
1436 Revlog supports delta chain with more unused data between payloads. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with the server.
1437
1438 re-delta-parent
1439 deltas within internal storage will choose a new base revision if needed
1440
1441 processed revlogs:
1442 - all-filelogs
1443 - changelog
1444 - manifest
1445
1446 beginning upgrade...
1447 repository locked and read-only
1448 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1449 (it is safe to interrupt this process any time before data migration completes)
1450 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1451 migrating 519 KB in store; 1.05 MB tracked data
1452 migrating filelogs:
1453 revlog-count: 3
1454 total-revisions: 3
1455 store-size: 518 KB
1456 tracked-size: 1.05 MB
1457 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1458 cloning 1 revisions from data/f0.i
1459 cloning 1 revisions from data/f2.i
1460 size-change: 0 bytes
1461 elapsed-time: [0-9 ]{9} seconds (re)
1462 migrating manifest:
1463 filelog-count: 1
1464 total-revisions: 3
1465 store-size: 367 bytes
1466 tracked-size: 238 bytes
1467 cloning 3 revisions from 00manifest.i
1468 size-change: 0 bytes
1469 elapsed-time: [0-9 ]{9} seconds (re)
1470 migrating changelog:
1471 total-revisions: 3
1472 store-size: 394 bytes
1473 tracked-size: 199 bytes
1474 cloning 3 revisions from 00changelog.i
1475 size-change: 0 bytes
1476 elapsed-time: [0-9 ]{9} seconds (re)
1477 finished migrating:
1478 total-revlog : 5
1479 total-revisions: 9
1480 size-change: 0 bytes
1481 elapsed-time: [0-9 ]{9} seconds (re)
1482 copying phaseroots
1483 copying requires
1484 data fully upgraded in a temporary repository
1485 marking source repository as being upgraded; clients will be unable to read from repository
1486 starting in-place swap of repository data
1487 replacing store...
1488 store replacement complete; repository was inconsistent for *s (glob)
1489 finalizing requirements file and making repository readable again
1490 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1491 $ hg verify -q
1492
1493 $ cd ..
1494
1495 store files with special filenames aren't encoded during copy
1496
1497 $ hg init store-filenames
1498 $ cd store-filenames
1499 $ touch foo
1500 $ hg -q commit -A -m initial
1501 $ touch .hg/store/.XX_special_filename
1502
1503 $ hg debugupgraderepo --run
1504 nothing to do
1505 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1506 upgrade will perform the following actions:
1507
1508 requirements
1509 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1510 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1511
1512 optimisations: re-delta-fulladd
1513
1514 re-delta-fulladd
1515 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1516
1517 processed revlogs:
1518 - all-filelogs
1519 - changelog
1520 - manifest
1521
1522 beginning upgrade...
1523 repository locked and read-only
1524 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1525 (it is safe to interrupt this process any time before data migration completes)
1526 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1527 migrating 301 bytes in store; 107 bytes tracked data
1528 migrating filelogs:
1529 revlog-count: 1
1530 total-revisions: 1
1531 store-size: 64 bytes
1532 tracked-size: 0 bytes
1533 size-change: 0 bytes
1534 elapsed-time: [0-9 ]{9} seconds (re)
1535 migrating manifest:
1536 filelog-count: 1
1537 total-revisions: 1
1538 store-size: 110 bytes
1539 tracked-size: 45 bytes
1540 size-change: 0 bytes
1541 elapsed-time: [0-9 ]{9} seconds (re)
1542 migrating changelog:
1543 total-revisions: 1
1544 store-size: 127 bytes
1545 tracked-size: 62 bytes
1546 size-change: 0 bytes
1547 elapsed-time: [0-9 ]{9} seconds (re)
1548 finished migrating:
1549 total-revlog : 3
1550 total-revisions: 3
1551 size-change: 0 bytes
1552 elapsed-time: [0-9 ]{9} seconds (re)
1553 copying .XX_special_filename
1554 copying phaseroots
1555 copying requires
1556 data fully upgraded in a temporary repository
1557 marking source repository as being upgraded; clients will be unable to read from repository
1558 starting in-place swap of repository data
1559 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1560 replacing store...
1561 store replacement complete; repository was inconsistent for *s (glob)
1562 finalizing requirements file and making repository readable again
1563 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1564 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1565 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1566
1567 fncache is valid after upgrade
1568
1569 $ hg debugrebuildfncache
1570 fncache already up to date
1571
1572 $ cd ..
1573
1574 Check upgrading a large file repository
1575 ---------------------------------------
1576
1577 $ hg init largefilesrepo
1578 $ cat << EOF >> largefilesrepo/.hg/hgrc
1579 > [extensions]
1580 > largefiles =
1581 > EOF
1582
1583 $ cd largefilesrepo
1584 $ touch foo
1585 $ hg add --large foo
1586 $ hg -q commit -m initial
1587 $ hg debugrequires
1588 dotencode
1589 fncache
1590 generaldelta
1591 largefiles
1592 persistent-nodemap (rust !)
1593 revlogv1
1594 share-safe
1595 sparserevlog
1596 store
1597
1598 $ hg debugupgraderepo --run
1599 nothing to do
1600 $ hg debugrequires
1601 dotencode
1602 fncache
1603 generaldelta
1604 largefiles
1605 persistent-nodemap (rust !)
1606 revlogv1
1607 share-safe
1608 sparserevlog
1609 store
1610
1611 $ cat << EOF >> .hg/hgrc
1612 > [extensions]
1613 > lfs =
1614 > [lfs]
1615 > threshold = 10
1616 > EOF
1617 $ echo '123456789012345' > lfs.bin
1618 $ hg ci -Am 'lfs.bin'
1619 adding lfs.bin
1620 $ hg debugrequires | grep lfs
1621 lfs
1622 $ find .hg/store/lfs -type f
1623 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1624
1625 $ hg debugupgraderepo --run
1626 nothing to do
1627
1628 $ hg debugrequires | grep lfs
1629 lfs
1630 $ find .hg/store/lfs -type f
1631 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1632 $ hg verify -q
1633 $ hg debugdata lfs.bin 0
1634 version https://git-lfs.github.com/spec/v1
1635 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1636 size 16
1637 x-is-binary 0
1638
1639 $ cd ..
1640
1641 repository config is taken in account
1642 -------------------------------------
1643
1644 $ cat << EOF >> $HGRCPATH
1645 > [format]
1646 > maxchainlen = 1
1647 > EOF
1648
1649 $ hg init localconfig
1650 $ cd localconfig
1651 $ cat << EOF > file
1652 > some content
1653 > with some length
1654 > to make sure we get a delta
1655 > after changes
1656 > very long
1657 > very long
1658 > very long
1659 > very long
1660 > very long
1661 > very long
1662 > very long
1663 > very long
1664 > very long
1665 > very long
1666 > very long
1667 > EOF
1668 $ hg -q commit -A -m A
1669 $ echo "new line" >> file
1670 $ hg -q commit -m B
1671 $ echo "new line" >> file
1672 $ hg -q commit -m C
1673
1674 $ cat << EOF >> .hg/hgrc
1675 > [format]
1676 > maxchainlen = 9001
1677 > EOF
1678 $ hg config format
1679 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1680 format.maxchainlen=9001
1681 $ hg debugdeltachain file --all-info
1682 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1683 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1684 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1685 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1686
1687 $ hg debugupgraderepo --run --optimize 're-delta-all'
1688 upgrade will perform the following actions:
1689
1690 requirements
1691 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1692 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1693
1694 optimisations: re-delta-all
1695
1696 re-delta-all
1697 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1698
1699 processed revlogs:
1700 - all-filelogs
1701 - changelog
1702 - manifest
1703
1704 beginning upgrade...
1705 repository locked and read-only
1706 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1707 (it is safe to interrupt this process any time before data migration completes)
1708 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1709 migrating 1019 bytes in store; 882 bytes tracked data
1710 migrating filelogs:
1711 revlog-count: 1
1712 total-revisions: 3
1713 store-size: 320 bytes
1714 tracked-size: 573 bytes
1715 size-change: -9 bytes
1716 elapsed-time: [0-9 ]{9} seconds (re)
1717 migrating manifest:
1718 filelog-count: 1
1719 total-revisions: 3
1720 store-size: 333 bytes
1721 tracked-size: 138 bytes
1722 size-change: 0 bytes
1723 elapsed-time: [0-9 ]{9} seconds (re)
1724 migrating changelog:
1725 total-revisions: 3
1726 store-size: 366 bytes
1727 tracked-size: 171 bytes
1728 size-change: 0 bytes
1729 elapsed-time: [0-9 ]{9} seconds (re)
1730 finished migrating:
1731 total-revlog : 3
1732 total-revisions: 9
1733 size-change: 0 bytes
1734 elapsed-time: [0-9 ]{9} seconds (re)
1735 copying phaseroots
1736 copying requires
1737 data fully upgraded in a temporary repository
1738 marking source repository as being upgraded; clients will be unable to read from repository
1739 starting in-place swap of repository data
1740 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1741 replacing store...
1742 store replacement complete; repository was inconsistent for *s (glob)
1743 finalizing requirements file and making repository readable again
1744 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1745 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1746 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1747 $ hg debugdeltachain file --all-info
1748 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1749 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1750 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1751 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1752 $ cd ..
1753
1754 $ cat << EOF >> $HGRCPATH
1755 > [format]
1756 > maxchainlen = 9001
1757 > EOF
1758
1759 Check upgrading a sparse-revlog repository
1760 ---------------------------------------
1761
1762 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1763 $ cd sparserevlogrepo
1764 $ touch foo
1765 $ hg add foo
1766 $ hg -q commit -m "foo"
1767 $ hg debugrequires
1768 dotencode
1769 fncache
1770 generaldelta
1771 persistent-nodemap (rust !)
1772 revlogv1
1773 share-safe
1774 store
1775
1776 Check that we can add the sparse-revlog format requirement
1777 $ hg debugupgraderepo --run --quiet \
1778 > --config format.sparse-revlog=yes \
1779 > --config format.use-delta-info-flags=no
1780 upgrade will perform the following actions:
1781
1782 requirements
1783 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1784 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1785 added: sparserevlog
1786
1787 processed revlogs:
1788 - all-filelogs
1789 - changelog
1790 - manifest
1791
1792 $ hg debugrequires
1793 dotencode
1794 fncache
1795 generaldelta
1796 persistent-nodemap (rust !)
1797 revlogv1
1798 share-safe
1799 sparserevlog
1800 store
1801
1802 Check that we can remove the sparse-revlog format requirement
1803 $ hg debugupgraderepo --run --quiet \
1804 > --config format.sparse-revlog=no \
1805 > --config format.use-delta-info-flags=no
1806 upgrade will perform the following actions:
1807
1808 requirements
1809 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1810 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1811 removed: sparserevlog
1812
1813 processed revlogs:
1814 - all-filelogs
1815 - changelog
1816 - manifest
1817
1818 $ hg debugrequires
1819 dotencode
1820 fncache
1821 generaldelta
1822 persistent-nodemap (rust !)
1823 revlogv1
1824 share-safe
1825 store
1826
1827 Check upgrading/downgrading delta-info-flag
1828 -------------------------------------------
1829
1830 upgrade
1831
1832 $ hg debugrequires
1833 dotencode
1834 fncache
1835 generaldelta
1836 persistent-nodemap (rust !)
1837 revlogv1
1838 share-safe
1839 store
1840 $ hg debugrevlog -c | grep -E 'flags|format'
1841 format : 1
1842 flags : (none)
1843 $ hg debugrevlog -m | grep -E 'flags|format'
1844 format : 1
1845 flags : inline, generaldelta
1846 $ hg debugrevlog foo | grep -E 'flags|format'
1847 format : 1
1848 flags : inline, generaldelta
1849 $ hg debugupgraderepo --run --quiet \
1850 > --config format.sparse-revlog=yes \
1851 > --config format.use-delta-info-flags=yes
1852 upgrade will perform the following actions:
1853
1854 requirements
1855 preserved: dotencode, fncache, generaldelta,( persistent-nodemap,)? revlogv1, share-safe, store (re)
1856 added: delta-info-revlog, sparserevlog
1857
1858 processed revlogs:
1859 - all-filelogs
1860 - changelog
1861 - manifest
1862
1863 $ hg debugrequires
1864 delta-info-revlog
1865 dotencode
1866 fncache
1867 generaldelta
1868 persistent-nodemap (rust !)
1869 revlogv1
1870 share-safe
1871 sparserevlog
1872 store
1873 $ hg debugrevlog -c | grep -E 'flags|format'
1874 format : 1
1875 flags : (none)
1876 $ hg debugrevlog -m | grep -E 'flags|format'
1877 format : 1
1878 flags : inline, generaldelta, delta-info
1879 $ hg debugrevlog foo | grep -E 'flags|format'
1880 format : 1
1881 flags : inline, generaldelta, hasmeta, delta-info
1882
1883 downgrade
1884
1885 $ hg debugrequires
1886 delta-info-revlog
1887 dotencode
1888 fncache
1889 generaldelta
1890 persistent-nodemap (rust !)
1891 revlogv1
1892 share-safe
1893 sparserevlog
1894 store
1895 $ hg debugrevlog -c | grep -E 'flags|format'
1896 format : 1
1897 flags : (none)
1898 $ hg debugrevlog -m | grep -E 'flags|format'
1899 format : 1
1900 flags : inline, generaldelta, delta-info
1901 $ hg debugrevlog foo | grep -E 'flags|format'
1902 format : 1
1903 flags : inline, generaldelta, hasmeta, delta-info
1904 $ hg debugupgraderepo --run --quiet \
1905 > --config format.sparse-revlog=yes \
1906 > --config format.use-delta-info-flags=no
1907 upgrade will perform the following actions:
1908
1909 requirements
1910 preserved: dotencode, fncache, generaldelta,( persistent-nodemap,)? revlogv1, share-safe, sparserevlog, store (re)
1911 removed: delta-info-revlog
1912
1913 processed revlogs:
1914 - all-filelogs
1915 - manifest
1916
1917 $ hg debugrequires
1918 dotencode
1919 fncache
1920 generaldelta
1921 persistent-nodemap (rust !)
1922 revlogv1
1923 share-safe
1924 sparserevlog
1925 store
1926 $ hg debugrevlog -c | grep -E 'flags|format'
1927 format : 1
1928 flags : (none)
1929 $ hg debugrevlog -m | grep -E 'flags|format'
1930 format : 1
1931 flags : inline, generaldelta
1932 $ hg debugrevlog foo | grep -E 'flags|format'
1933 format : 1
1934 flags : inline, generaldelta
1935
1936
1937 #if zstd
1938
1939 Check upgrading to a zstd revlog
1940 --------------------------------
1941
1942 upgrade
1943
1944 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1945 upgrade will perform the following actions:
1946
1947 requirements
1948 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1949 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1950 added: revlog-compression-zstd
1951
1952 processed revlogs:
1953 - all-filelogs
1954 - changelog
1955 - manifest
1956
1957 $ hg debugformat -v compression compression-level
1958 format-variant repo config default
1959 compression: zlib zlib zlib (no-zstd !)
1960 compression: zstd zlib zstd (zstd !)
1961 compression-level: default default default
1962 $ hg debugrequires
1963 dotencode
1964 fncache
1965 generaldelta
1966 persistent-nodemap (rust !)
1967 revlog-compression-zstd
1968 revlogv1
1969 share-safe
1970 sparserevlog
1971 store
1972
1973 downgrade
1974
1975 $ hg debugupgraderepo --run --no-backup --quiet
1976 upgrade will perform the following actions:
1977
1978 requirements
1979 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1980 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1981 removed: revlog-compression-zstd
1982
1983 processed revlogs:
1984 - all-filelogs
1985 - changelog
1986 - manifest
1987
1988 $ hg debugformat -v compression compression-level
1989 format-variant repo config default
1990 compression: zlib zlib zlib (no-zstd !)
1991 compression: zlib zlib zstd (zstd !)
1992 compression-level: default default default
1993 $ hg debugrequires
1994 dotencode
1995 fncache
1996 generaldelta
1997 persistent-nodemap (rust !)
1998 revlogv1
1999 share-safe
2000 sparserevlog
2001 store
2002
2003 upgrade from hgrc
2004
2005 $ cat >> .hg/hgrc << EOF
2006 > [format]
2007 > revlog-compression=zstd
2008 > EOF
2009 $ hg debugupgraderepo --run --no-backup --quiet
2010 upgrade will perform the following actions:
2011
2012 requirements
2013 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
2014 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
2015 added: revlog-compression-zstd
2016
2017 processed revlogs:
2018 - all-filelogs
2019 - changelog
2020 - manifest
2021
2022 $ hg debugformat -v compression compression-level
2023 format-variant repo config default
2024 compression: zlib zlib zlib (no-zstd !)
2025 compression: zstd zstd zstd (zstd !)
2026 compression-level: default default default
2027 $ hg debugrequires
2028 dotencode
2029 fncache
2030 generaldelta
2031 persistent-nodemap (rust !)
2032 revlog-compression-zstd
2033 revlogv1
2034 share-safe
2035 sparserevlog
2036 store
2037
2038 #endif
2039
2040 Check upgrading to a revlog format supporting sidedata
2041 ------------------------------------------------------
2042
2043 upgrade
2044
2045 $ hg debugsidedata -c 0
2046 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
2047 upgrade will perform the following actions:
2048
2049 requirements
2050 preserved: generaldelta, share-safe, sparserevlog, store (no-zstd !)
2051 preserved: generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
2052 preserved: generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
2053 removed: dotencode, fncache, revlogv1
2054 added: exp-revlogv2.2, fileindex-v1
2055
2056 processed revlogs:
2057 - all-filelogs
2058 - changelog
2059 - manifest
2060
2061 $ hg debugformat -v
2062 format-variant repo config default
2063 fncache: no yes yes
2064 fileindex-v1: yes no no
2065 dirstate-v2: no no no
2066 tracked-hint: no no no
2067 dotencode: no yes yes
2068 fragile-plain-encode: no no no
2069 generaldelta: yes yes yes
2070 share-safe: yes yes yes
2071 sparserevlog: yes yes yes
2072 delta-info-flags: no no no
2073 persistent-nodemap: no no no (no-rust !)
2074 persistent-nodemap: yes yes no (rust !)
2075 copies-sdc: no no no
2076 revlog-v2: yes no no
2077 changelog-v2: no no no
2078 plain-cl-delta: yes yes yes
2079 compression: zlib zlib zlib (no-zstd !)
2080 compression: zstd zstd zstd (zstd !)
2081 compression-level: default default default
2082 $ hg debugrequires
2083 exp-revlogv2.2
2084 fileindex-v1
2085 generaldelta
2086 persistent-nodemap (rust !)
2087 revlog-compression-zstd (zstd !)
2088 share-safe
2089 sparserevlog
2090 store
2091 $ hg debugsidedata -c 0
2092 2 sidedata entries
2093 entry-0001 size 4
2094 entry-0002 size 32
2095
2096 downgrade
2097
2098 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
2099 upgrade will perform the following actions:
2100
2101 requirements
2102 preserved: generaldelta, share-safe, sparserevlog, store (no-zstd !)
2103 preserved: generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
2104 preserved: generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
2105 removed: exp-revlogv2.2, fileindex-v1
2106 added: dotencode, fncache, revlogv1
2107
2108 processed revlogs:
2109 - all-filelogs
2110 - changelog
2111 - manifest
2112
2113 $ hg debugformat -v
2114 format-variant repo config default
2115 fncache: yes yes yes
2116 fileindex-v1: no no no
2117 dirstate-v2: no no no
2118 tracked-hint: no no no
2119 dotencode: yes yes yes
2120 fragile-plain-encode: no no no
2121 generaldelta: yes yes yes
2122 share-safe: yes yes yes
2123 sparserevlog: yes yes yes
2124 delta-info-flags: no no no
2125 persistent-nodemap: no no no (no-rust !)
2126 persistent-nodemap: yes yes no (rust !)
2127 copies-sdc: no no no
2128 revlog-v2: no no no
2129 changelog-v2: no no no
2130 plain-cl-delta: yes yes yes
2131 compression: zlib zlib zlib (no-zstd !)
2132 compression: zstd zstd zstd (zstd !)
2133 compression-level: default default default
2134 $ hg debugrequires
2135 dotencode
2136 fncache
2137 generaldelta
2138 persistent-nodemap (rust !)
2139 revlog-compression-zstd (zstd !)
2140 revlogv1
2141 share-safe
2142 sparserevlog
2143 store
2144 $ hg debugsidedata -c 0
2145
2146 upgrade from hgrc
2147
2148 $ cat >> .hg/hgrc << EOF
2149 > [experimental]
2150 > revlogv2=enable-unstable-format-and-corrupt-my-data
2151 > EOF
2152 $ hg debugupgraderepo --run --no-backup --quiet
2153 upgrade will perform the following actions:
2154
2155 requirements
2156 preserved: generaldelta, share-safe, sparserevlog, store (no-zstd !)
2157 preserved: generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
2158 preserved: generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
2159 removed: dotencode, fncache, revlogv1
2160 added: exp-revlogv2.2, fileindex-v1
2161
2162 processed revlogs:
2163 - all-filelogs
2164 - changelog
2165 - manifest
2166
2167 $ hg debugformat -v
2168 format-variant repo config default
2169 fncache: no no yes
2170 fileindex-v1: yes yes no
2171 dirstate-v2: no no no
2172 tracked-hint: no no no
2173 dotencode: no no yes
2174 fragile-plain-encode: no no no
2175 generaldelta: yes yes yes
2176 share-safe: yes yes yes
2177 sparserevlog: yes yes yes
2178 delta-info-flags: no no no
2179 persistent-nodemap: no no no (no-rust !)
2180 persistent-nodemap: yes yes no (rust !)
2181 copies-sdc: no no no
2182 revlog-v2: yes yes no
2183 changelog-v2: no no no
2184 plain-cl-delta: yes yes yes
2185 compression: zlib zlib zlib (no-zstd !)
2186 compression: zstd zstd zstd (zstd !)
2187 compression-level: default default default
2188 $ hg debugrequires
2189 exp-revlogv2.2
2190 fileindex-v1
2191 generaldelta
2192 persistent-nodemap (rust !)
2193 revlog-compression-zstd (zstd !)
2194 share-safe
2195 sparserevlog
2196 store
2197 $ hg debugsidedata -c 0
2198
2199 Demonstrate that nothing to perform upgrade will still run all the way through
2200
2201 $ hg debugupgraderepo --run
2202 nothing to do
2203
2204 #if no-rust
2205
2206 $ cat << EOF >> $HGRCPATH
2207 > [storage]
2208 > dirstate-v2.slow-path = allow
2209 > EOF
2210
2211 #endif
2212
2213 Upgrade to dirstate-v2
2214
2215 $ hg debugformat -v --config format.use-dirstate-v2=1 dirstate-v2
2216 format-variant repo config default
2217 dirstate-v2: no yes no
2218 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
2219 upgrade will perform the following actions:
2220
2221 requirements
2222 preserved: * (glob)
2223 added: dirstate-v2
2224
2225 dirstate-v2
2226 "hg status" will be faster
2227
2228 no revlogs to process
2229
2230 beginning upgrade...
2231 repository locked and read-only
2232 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
2233 (it is safe to interrupt this process any time before data migration completes)
2234 upgrading to dirstate-v2 from v1
2235 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
2236 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
2237 $ ls .hg/upgradebackup.*/dirstate
2238 .hg/upgradebackup.*/dirstate (glob)
2239 $ hg debugformat -v dirstate-v2
2240 format-variant repo config default
2241 dirstate-v2: yes no no
2242 $ hg status
2243 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
2244 dirstate-v2
2245
2246 Downgrade from dirstate-v2
2247
2248 $ hg debugupgraderepo --run
2249 upgrade will perform the following actions:
2250
2251 requirements
2252 preserved: * (glob)
2253 removed: dirstate-v2
2254
2255 no revlogs to process
2256
2257 beginning upgrade...
2258 repository locked and read-only
2259 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
2260 (it is safe to interrupt this process any time before data migration completes)
2261 downgrading from dirstate-v2 to v1
2262 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
2263 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
2264 $ hg debugformat -v dirstate-v2
2265 format-variant repo config default
2266 dirstate-v2: no no no
2267 $ hg status
2268
2269 $ cd ..
2270
2271 dirstate-v2: upgrade and downgrade from and empty repository:
2272 -------------------------------------------------------------
2273
2274 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
2275 $ cd dirstate-v2-empty
2276 $ hg debugformat dirstate-v2
2277 format-variant repo
2278 dirstate-v2: no
2279
2280 upgrade
2281
2282 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
2283 upgrade will perform the following actions:
2284
2285 requirements
2286 preserved: * (glob)
2287 added: dirstate-v2
2288
2289 dirstate-v2
2290 "hg status" will be faster
2291
2292 no revlogs to process
2293
2294 beginning upgrade...
2295 repository locked and read-only
2296 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2297 (it is safe to interrupt this process any time before data migration completes)
2298 upgrading to dirstate-v2 from v1
2299 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
2300 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2301 $ hg debugformat dirstate-v2
2302 format-variant repo
2303 dirstate-v2: yes
2304
2305 downgrade
2306
2307 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
2308 upgrade will perform the following actions:
2309
2310 requirements
2311 preserved: * (glob)
2312 removed: dirstate-v2
2313
2314 no revlogs to process
2315
2316 beginning upgrade...
2317 repository locked and read-only
2318 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2319 (it is safe to interrupt this process any time before data migration completes)
2320 downgrading from dirstate-v2 to v1
2321 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
2322 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
2323 $ hg debugformat dirstate-v2
2324 format-variant repo
2325 dirstate-v2: no
2326
2327 $ cd ..
2328
2329 Test automatic upgrade/downgrade
2330 ================================
2331
2332
2333 For dirstate v2
2334 ---------------
2335
2336 create an initial repository
2337
2338 $ hg init auto-upgrade \
2339 > --config format.use-dirstate-v2=no \
2340 > --config format.use-dirstate-tracked-hint=yes \
2341 > --config format.use-share-safe=no
2342 $ hg debugbuilddag -R auto-upgrade --new-file .+5
2343 $ hg -R auto-upgrade update
2344 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
2345 $ hg debugformat -R auto-upgrade dirstate-v2
2346 format-variant repo
2347 dirstate-v2: no
2348
2349 upgrade it to dirstate-v2 automatically
2350
2351 $ hg status -R auto-upgrade \
2352 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2353 > --config format.use-dirstate-v2=yes
2354 automatically upgrading repository to the `dirstate-v2` feature
2355 (see `hg help config.format.use-dirstate-v2` for details)
2356 $ hg debugformat -R auto-upgrade dirstate-v2
2357 format-variant repo
2358 dirstate-v2: yes
2359
2360 downgrade it from dirstate-v2 automatically
2361
2362 $ hg status -R auto-upgrade \
2363 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2364 > --config format.use-dirstate-v2=no
2365 automatically downgrading repository from the `dirstate-v2` feature
2366 (see `hg help config.format.use-dirstate-v2` for details)
2367 $ hg debugformat -R auto-upgrade dirstate-v2
2368 format-variant repo
2369 dirstate-v2: no
2370
2371
2372 For multiple change at the same time
2373 ------------------------------------
2374
2375 $ hg debugformat -R auto-upgrade dirstate-v2 tracked share-safe
2376 format-variant repo
2377 dirstate-v2: no
2378 tracked-hint: yes
2379 share-safe: no
2380
2381 $ hg status -R auto-upgrade \
2382 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2383 > --config format.use-dirstate-v2=yes \
2384 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2385 > --config format.use-dirstate-tracked-hint=no\
2386 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2387 > --config format.use-share-safe=yes
2388 automatically upgrading repository to the `dirstate-v2` feature
2389 (see `hg help config.format.use-dirstate-v2` for details)
2390 automatically upgrading repository to the `share-safe` feature
2391 (see `hg help config.format.use-share-safe` for details)
2392 automatically downgrading repository from the `tracked-hint` feature
2393 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2394 $ hg debugformat -R auto-upgrade dirstate-v2 tracked share-safe
2395 format-variant repo
2396 dirstate-v2: yes
2397 tracked-hint: no
2398 share-safe: yes
2399
2400 Quiet upgrade and downgrade
2401 ---------------------------
2402
2403
2404 $ hg debugformat -R auto-upgrade dirstate-v2 tracked share-safe
2405 format-variant repo
2406 dirstate-v2: yes
2407 tracked-hint: no
2408 share-safe: yes
2409 $ hg status -R auto-upgrade \
2410 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2411 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2412 > --config format.use-dirstate-v2=no \
2413 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2414 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2415 > --config format.use-dirstate-tracked-hint=yes \
2416 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2417 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2418 > --config format.use-share-safe=no
2419
2420 $ hg debugformat -R auto-upgrade dirstate-v2 tracked share-safe
2421 format-variant repo
2422 dirstate-v2: no
2423 tracked-hint: yes
2424 share-safe: no
2425
2426 $ hg status -R auto-upgrade \
2427 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2428 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2429 > --config format.use-dirstate-v2=yes \
2430 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2431 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2432 > --config format.use-dirstate-tracked-hint=no\
2433 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2434 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2435 > --config format.use-share-safe=yes
2436 $ hg debugformat -R auto-upgrade dirstate-v2 tracked share-safe
2437 format-variant repo
2438 dirstate-v2: yes
2439 tracked-hint: no
2440 share-safe: yes
2441
2442 #if unix-permissions
2443
2444 Attempting Auto-upgrade on a read-only repository
2445 -------------------------------------------------
2446
2447 $ chmod -R a-w auto-upgrade
2448
2449 $ hg status -R auto-upgrade \
2450 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2451 > --config format.use-dirstate-v2=no
2452 $ hg debugformat -R auto-upgrade dirstate-v2
2453 format-variant repo
2454 dirstate-v2: yes
2455
2456 $ chmod -R u+w auto-upgrade
2457
2458 #endif
2459
2460 Attempting Auto-upgrade on a locked repository
2461 ----------------------------------------------
2462
2463 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2464 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2465 $ hg status -R auto-upgrade \
2466 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2467 > --config format.use-dirstate-v2=no
2468 $ hg debugformat -R auto-upgrade dirstate-v2
2469 format-variant repo
2470 dirstate-v2: yes
2471
2472 $ killdaemons.py