Show More
@@ -142,3 +142,16 b' Support for this requirement was added i' | |||
|
142 | 142 | August 2019). The requirement will only be present on repositories |
|
143 | 143 | that have opted in to this format (by having |
|
144 | 144 | ``format.bookmarks-in-store=true`` set when they were created). |
|
145 | ||
|
146 | persistent-nodemap | |
|
147 | ================== | |
|
148 | ||
|
149 | The `nodemap` index (mapping nodeid to local revision number) is persisted on | |
|
150 | disk. This provides speed benefit (if the associated native code is used). The | |
|
151 | persistent nodemap is only used for two revlogs: the changelog and the | |
|
152 | manifestlog. | |
|
153 | ||
|
154 | Support for this requirement was added in Mercurial 5.5 (released August 2020). | |
|
155 | Note that as of 5.5, only installations compiled with the Rust extension will | |
|
156 | benefit from a speedup. The other installations will do the necessary work to | |
|
157 | keep the index up to date, but will suffer a slowdown. |
@@ -78,6 +78,7 b' def supportremovedrequirements(repo):' | |||
|
78 | 78 | localrepo.SPARSEREVLOG_REQUIREMENT, |
|
79 | 79 | localrepo.SIDEDATA_REQUIREMENT, |
|
80 | 80 | localrepo.COPIESSDC_REQUIREMENT, |
|
81 | localrepo.NODEMAP_REQUIREMENT, | |
|
81 | 82 | } |
|
82 | 83 | for name in compression.compengines: |
|
83 | 84 | engine = compression.compengines[name] |
@@ -105,6 +106,7 b' def supporteddestrequirements(repo):' | |||
|
105 | 106 | localrepo.SPARSEREVLOG_REQUIREMENT, |
|
106 | 107 | localrepo.SIDEDATA_REQUIREMENT, |
|
107 | 108 | localrepo.COPIESSDC_REQUIREMENT, |
|
109 | localrepo.NODEMAP_REQUIREMENT, | |
|
108 | 110 | } |
|
109 | 111 | for name in compression.compengines: |
|
110 | 112 | engine = compression.compengines[name] |
@@ -132,6 +134,7 b' def allowednewrequirements(repo):' | |||
|
132 | 134 | localrepo.SPARSEREVLOG_REQUIREMENT, |
|
133 | 135 | localrepo.SIDEDATA_REQUIREMENT, |
|
134 | 136 | localrepo.COPIESSDC_REQUIREMENT, |
|
137 | localrepo.NODEMAP_REQUIREMENT, | |
|
135 | 138 | } |
|
136 | 139 | for name in compression.compengines: |
|
137 | 140 | engine = compression.compengines[name] |
@@ -990,7 +993,7 b' def _filterstorefile(srcrepo, dstrepo, r' | |||
|
990 | 993 | Function should return ``True`` if the file is to be copied. |
|
991 | 994 | """ |
|
992 | 995 | # Skip revlogs. |
|
993 | if path.endswith((b'.i', b'.d')): | |
|
996 | if path.endswith((b'.i', b'.d', b'.n', b'.nd')): | |
|
994 | 997 | return False |
|
995 | 998 | # Skip transaction related files. |
|
996 | 999 | if path.startswith(b'undo'): |
@@ -439,3 +439,99 b' Check that a failing transaction will pr' | |||
|
439 | 439 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
440 | 440 | .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
441 | 441 | .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
442 | ||
|
443 | Test upgrade / downgrade | |
|
444 | ======================== | |
|
445 | ||
|
446 | downgrading | |
|
447 | ||
|
448 | $ cat << EOF >> .hg/hgrc | |
|
449 | > [format] | |
|
450 | > use-persistent-nodemap=no | |
|
451 | > EOF | |
|
452 | $ hg debugformat -v | |
|
453 | format-variant repo config default | |
|
454 | fncache: yes yes yes | |
|
455 | dotencode: yes yes yes | |
|
456 | generaldelta: yes yes yes | |
|
457 | sparserevlog: yes yes yes | |
|
458 | sidedata: no no no | |
|
459 | persistent-nodemap: yes no no | |
|
460 | copies-sdc: no no no | |
|
461 | plain-cl-delta: yes yes yes | |
|
462 | compression: zlib zlib zlib | |
|
463 | compression-level: default default default | |
|
464 | $ hg debugupgraderepo --run --no-backup --quiet | |
|
465 | upgrade will perform the following actions: | |
|
466 | ||
|
467 | requirements | |
|
468 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store | |
|
469 | removed: persistent-nodemap | |
|
470 | ||
|
471 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
|
472 | [1] | |
|
473 | $ hg debugnodemap --metadata | |
|
474 | ||
|
475 | ||
|
476 | upgrading | |
|
477 | ||
|
478 | $ cat << EOF >> .hg/hgrc | |
|
479 | > [format] | |
|
480 | > use-persistent-nodemap=yes | |
|
481 | > EOF | |
|
482 | $ hg debugformat -v | |
|
483 | format-variant repo config default | |
|
484 | fncache: yes yes yes | |
|
485 | dotencode: yes yes yes | |
|
486 | generaldelta: yes yes yes | |
|
487 | sparserevlog: yes yes yes | |
|
488 | sidedata: no no no | |
|
489 | persistent-nodemap: no yes no | |
|
490 | copies-sdc: no no no | |
|
491 | plain-cl-delta: yes yes yes | |
|
492 | compression: zlib zlib zlib | |
|
493 | compression-level: default default default | |
|
494 | $ hg debugupgraderepo --run --no-backup --quiet | |
|
495 | upgrade will perform the following actions: | |
|
496 | ||
|
497 | requirements | |
|
498 | preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store | |
|
499 | added: persistent-nodemap | |
|
500 | ||
|
501 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
|
502 | 00changelog-*.nd (glob) | |
|
503 | 00changelog.n | |
|
504 | 00manifest-*.nd (glob) | |
|
505 | 00manifest.n | |
|
506 | ||
|
507 | $ hg debugnodemap --metadata | |
|
508 | uid: * (glob) | |
|
509 | tip-rev: 5005 | |
|
510 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
|
511 | data-length: 121088 | |
|
512 | data-unused: 0 | |
|
513 | data-unused: 0.000% | |
|
514 | ||
|
515 | Running unrelated upgrade | |
|
516 | ||
|
517 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all | |
|
518 | upgrade will perform the following actions: | |
|
519 | ||
|
520 | requirements | |
|
521 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store | |
|
522 | ||
|
523 | optimisations: re-delta-all | |
|
524 | ||
|
525 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
|
526 | 00changelog-*.nd (glob) | |
|
527 | 00changelog.n | |
|
528 | 00manifest-*.nd (glob) | |
|
529 | 00manifest.n | |
|
530 | ||
|
531 | $ hg debugnodemap --metadata | |
|
532 | uid: * (glob) | |
|
533 | tip-rev: 5005 | |
|
534 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
|
535 | data-length: 121088 | |
|
536 | data-unused: 0 | |
|
537 | data-unused: 0.000% |
General Comments 0
You need to be logged in to leave comments.
Login now