Show More
@@ -128,6 +128,14 b' def update_persistent_nodemap(revlog):' | |||
|
128 | 128 | notr._postclose[k](None) |
|
129 | 129 | |
|
130 | 130 | |
|
131 | def delete_nodemap(tr, repo, revlog): | |
|
132 | """ Delete nodemap data on disk for a given revlog""" | |
|
133 | if revlog.nodemap_file is None: | |
|
134 | msg = "calling persist nodemap on a revlog without the feature enabled" | |
|
135 | raise error.ProgrammingError(msg) | |
|
136 | repo.svfs.unlink(revlog.nodemap_file) | |
|
137 | ||
|
138 | ||
|
131 | 139 | def persist_nodemap(tr, revlog, pending=False, force=False): |
|
132 | 140 | """Write nodemap data on disk for a given revlog""" |
|
133 | 141 | if getattr(revlog, 'filteredrevs', ()): |
@@ -476,6 +476,27 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||
|
476 | 476 | tr, unfi.manifestlog._rootstore._revlog, force=True |
|
477 | 477 | ) |
|
478 | 478 | scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) |
|
479 | elif ( | |
|
480 | len(upgrade_op.removed_actions) == 1 | |
|
481 | and [ | |
|
482 | x | |
|
483 | for x in upgrade_op.removed_actions | |
|
484 | if x.name == b'persistent-nodemap' | |
|
485 | ] | |
|
486 | and not upgrade_op.upgrade_actions | |
|
487 | ): | |
|
488 | ui.status( | |
|
489 | _(b'downgrading repository to not use persistent nodemap feature\n') | |
|
490 | ) | |
|
491 | with srcrepo.transaction(b'upgrade') as tr: | |
|
492 | unfi = srcrepo.unfiltered() | |
|
493 | cl = unfi.changelog | |
|
494 | nodemap.delete_nodemap(tr, srcrepo, cl) | |
|
495 | # check comment 20 lines above for accessing private attributes | |
|
496 | nodemap.delete_nodemap( | |
|
497 | tr, srcrepo, unfi.manifestlog._rootstore._revlog | |
|
498 | ) | |
|
499 | scmutil.writereporequirements(srcrepo, upgrade_op.new_requirements) | |
|
479 | 500 | else: |
|
480 | 501 | with dstrepo.transaction(b'upgrade') as tr: |
|
481 | 502 | _clonerevlogs( |
@@ -581,7 +581,7 b' downgrading' | |||
|
581 | 581 | plain-cl-delta: yes yes yes |
|
582 | 582 | compression: zlib zlib zlib |
|
583 | 583 | compression-level: default default default |
|
584 |
$ hg debugupgraderepo --run --no-backup |
|
|
584 | $ hg debugupgraderepo --run --no-backup | |
|
585 | 585 | upgrade will perform the following actions: |
|
586 | 586 | |
|
587 | 587 | requirements |
@@ -593,8 +593,17 b' downgrading' | |||
|
593 | 593 | - changelog |
|
594 | 594 | - manifest |
|
595 | 595 | |
|
596 | beginning upgrade... | |
|
597 | repository locked and read-only | |
|
598 | creating temporary repository to stage upgraded data: $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
|
599 | (it is safe to interrupt this process any time before data migration completes) | |
|
600 | downgrading repository to not use persistent nodemap feature | |
|
601 | removing temporary repository $TESTTMP/test-repo/.hg/upgrade.* (glob) | |
|
596 | 602 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
597 | [1] | |
|
603 | 00changelog-*.nd (glob) | |
|
604 | 00manifest-*.nd (glob) | |
|
605 | undo.backup.00changelog.n | |
|
606 | undo.backup.00manifest.n | |
|
598 | 607 | $ hg debugnodemap --metadata |
|
599 | 608 | |
|
600 | 609 | |
@@ -643,6 +652,8 b' upgrading' | |||
|
643 | 652 | 00changelog.n |
|
644 | 653 | 00manifest-*.nd (glob) |
|
645 | 654 | 00manifest.n |
|
655 | undo.backup.00changelog.n | |
|
656 | undo.backup.00manifest.n | |
|
646 | 657 | |
|
647 | 658 | $ hg debugnodemap --metadata |
|
648 | 659 | uid: * (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now