# HG changeset patch # User Pierre-Yves David # Date 2020-11-30 13:07:23 # Node ID 6c960b708ac499371503b30ccb51e647e3fa4a7d # Parent 0c02c2a0badbf7249a551646156b626004799e54 upgrade: display the list of processed revlog before proceeding This help to make sure we don't wrongly skip some in the test and to make sure the user is aware of the amount of processing they is signing up for. Differential Revision: https://phab.mercurial-scm.org/D9469 diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py --- a/mercurial/upgrade.py +++ b/mercurial/upgrade.py @@ -742,9 +742,9 @@ def _copyrevlog(tr, destrepo, oldrl, une destrepo.svfs.fncache.add(unencodedname[:-2] + b'.d') -UPGRADE_CHANGELOG = object() -UPGRADE_MANIFEST = object() -UPGRADE_FILELOGS = object() +UPGRADE_CHANGELOG = b"changelog" +UPGRADE_MANIFEST = b"manifest" +UPGRADE_FILELOGS = b"all-filelogs" UPGRADE_ALL_REVLOGS = frozenset( [UPGRADE_CHANGELOG, UPGRADE_MANIFEST, UPGRADE_FILELOGS] @@ -1339,6 +1339,15 @@ def upgraderepo( for a in actions: ui.status(b'%s\n %s\n\n' % (a.name, a.upgrademessage)) + def print_affected_revlogs(): + if not revlogs: + ui.write((b'no revlogs to process\n')) + else: + ui.write((b'processed revlogs:\n')) + for r in sorted(revlogs): + ui.write((b' - %s\n' % r)) + ui.write((b'\n')) + if not run: fromconfig = [] onlydefault = [] @@ -1390,6 +1399,7 @@ def upgraderepo( printrequirements() printoptimisations() printupgradeactions() + print_affected_revlogs() unusedoptimize = [i for i in alloptimizations if i not in actions] @@ -1409,6 +1419,7 @@ def upgraderepo( printrequirements() printoptimisations() printupgradeactions() + print_affected_revlogs() upgradeactions = [a.name for a in actions] diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t --- a/tests/test-copies-chain-merge.t +++ b/tests/test-copies-chain-merge.t @@ -664,6 +664,11 @@ We upgrade a repository that is not usin preserved: * (glob) added: exp-copies-sidedata-changeset, exp-sidedata-flag + processed revlogs: + - all-filelogs + - changelog + - manifest + #endif diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t +++ b/tests/test-lfs-serve.t @@ -133,6 +133,11 @@ non-lfs content, and the extension enabl requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + $ grep 'lfs' .hg/requires $SERVER_REQUIRES [1] diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t --- a/tests/test-persistent-nodemap.t +++ b/tests/test-persistent-nodemap.t @@ -492,6 +492,11 @@ downgrading preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store removed: persistent-nodemap + processed revlogs: + - all-filelogs + - changelog + - manifest + $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' [1] $ hg debugnodemap --metadata @@ -523,6 +528,11 @@ upgrading preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store added: persistent-nodemap + processed revlogs: + - all-filelogs + - changelog + - manifest + $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' 00changelog-*.nd (glob) 00changelog.n @@ -547,6 +557,11 @@ Running unrelated upgrade optimisations: re-delta-all + processed revlogs: + - all-filelogs + - changelog + - manifest + $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' 00changelog-*.nd (glob) 00changelog.n diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t --- a/tests/test-share-safe.t +++ b/tests/test-share-safe.t @@ -215,6 +215,11 @@ Disable zstd related tests because its n preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlogv1, sparserevlog, store added: revlog-compression-zstd + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg log -r . changeset: 1:5f6d8a4bf34a user: test @@ -237,6 +242,11 @@ Disable zstd related tests because its n preserved: dotencode, exp-sharesafe, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) added: persistent-nodemap + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg log -r . changeset: 1:5f6d8a4bf34a user: test @@ -335,6 +345,11 @@ Upgrade preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store added: exp-sharesafe + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugupgraderepo --run -q upgrade will perform the following actions: @@ -342,6 +357,11 @@ Upgrade preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store added: exp-sharesafe + processed revlogs: + - all-filelogs + - changelog + - manifest + repository upgraded to share safe mode, existing shares will still work in old non-safe mode. Re-share existing shares to use them in safe mode New shares will be created in safe mode. $ hg debugrequirements @@ -408,6 +428,11 @@ Test that downgrading works too preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store removed: exp-sharesafe + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugupgraderepo -q --run upgrade will perform the following actions: @@ -415,6 +440,11 @@ Test that downgrading works too preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store removed: exp-sharesafe + processed revlogs: + - all-filelogs + - changelog + - manifest + repository downgraded to not use share safe mode, existing shares will not work and needs to be reshared. $ hg debugrequirements diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t --- a/tests/test-upgrade-repo.t +++ b/tests/test-upgrade-repo.t @@ -179,6 +179,11 @@ An upgrade of a repository created with requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + additional optimizations are available by specifying "--optimize ": re-delta-parent @@ -198,6 +203,11 @@ An upgrade of a repository created with requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + --optimize can be used to add optimizations @@ -213,6 +223,11 @@ An upgrade of a repository created with re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + - changelog + - manifest + additional optimizations are available by specifying "--optimize ": re-delta-multibase @@ -239,6 +254,11 @@ modern form of the option re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + - changelog + - manifest + additional optimizations are available by specifying "--optimize ": re-delta-multibase @@ -256,6 +276,11 @@ modern form of the option optimisations: re-delta-parent + processed revlogs: + - all-filelogs + - changelog + - manifest + unknown optimization: @@ -357,6 +382,11 @@ Various sub-optimal detections work sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. + processed revlogs: + - all-filelogs + - changelog + - manifest + additional optimizations are available by specifying "--optimize ": re-delta-parent @@ -376,6 +406,11 @@ Various sub-optimal detections work preserved: revlogv1, store added: dotencode, fncache, generaldelta, sparserevlog + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg --config format.dotencode=false debugupgraderepo repository lacks features recommended by current config options: @@ -410,6 +445,11 @@ Various sub-optimal detections work sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. + processed revlogs: + - all-filelogs + - changelog + - manifest + additional optimizations are available by specifying "--optimize ": re-delta-parent @@ -436,6 +476,11 @@ Upgrading a repository that is already m requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob) @@ -487,6 +532,11 @@ make sure we have a .d file generaldelta 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 + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -583,6 +633,11 @@ unless --no-backup is passed sparserevlog Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server. + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -622,6 +677,9 @@ We can restrict optimization to some rev re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -698,6 +756,10 @@ Check we can select negatively re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + - changelog + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -746,6 +808,9 @@ Check that we can select changelog only re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - changelog + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -794,6 +859,9 @@ Check that we can select filelog only re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -847,6 +915,11 @@ Check you can't skip revlog clone during re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -901,6 +974,11 @@ Check you can't skip revlog clone during re-delta-parent deltas within internal storage will choose a new base revision if needed + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob) @@ -952,6 +1030,11 @@ store files with special filenames aren' requirements preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob) @@ -988,6 +1071,11 @@ store files with special filenames aren' re-delta-fulladd 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 + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob) @@ -1049,6 +1137,11 @@ Check upgrading a large file repository requirements preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) @@ -1102,6 +1195,11 @@ Check upgrading a large file repository requirements preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob) @@ -1202,6 +1300,11 @@ repository config is taken in account re-delta-all deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time + processed revlogs: + - all-filelogs + - changelog + - manifest + beginning upgrade... repository locked and read-only creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob) @@ -1261,6 +1364,11 @@ Check that we can add the sparse-revlog preserved: dotencode, fncache, generaldelta, revlogv1, store added: sparserevlog + processed revlogs: + - all-filelogs + - changelog + - manifest + $ cat .hg/requires dotencode fncache @@ -1277,6 +1385,11 @@ Check that we can remove the sparse-revl preserved: dotencode, fncache, generaldelta, revlogv1, store removed: sparserevlog + processed revlogs: + - all-filelogs + - changelog + - manifest + $ cat .hg/requires dotencode fncache @@ -1298,6 +1411,11 @@ upgrade preserved: dotencode, fncache, generaldelta, revlogv1, store added: revlog-compression-zstd, sparserevlog + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes @@ -1329,6 +1447,11 @@ downgrade preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store removed: revlog-compression-zstd + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes @@ -1363,6 +1486,11 @@ upgrade from hgrc preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store added: revlog-compression-zstd + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes @@ -1401,6 +1529,11 @@ upgrade added: exp-sidedata-flag (zstd !) added: exp-sidedata-flag, sparserevlog (no-zstd !) + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes @@ -1439,6 +1572,11 @@ downgrade preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) removed: exp-sidedata-flag + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes @@ -1477,6 +1615,11 @@ upgrade from hgrc preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, sparserevlog, store (zstd !) added: exp-sidedata-flag + processed revlogs: + - all-filelogs + - changelog + - manifest + $ hg debugformat -v format-variant repo config default fncache: yes yes yes