upgrade: display the list of processed revlog before proceeding
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 30 Nov 2020 14:07:23 +0100
changeset 46039 6c960b708ac4
parent 46038 0c02c2a0badb
child 46040 8d54944eaeb0
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
mercurial/upgrade.py
tests/test-copies-chain-merge.t
tests/test-lfs-serve.t
tests/test-persistent-nodemap.t
tests/test-share-safe.t
tests/test-upgrade-repo.t
--- a/mercurial/upgrade.py	Wed Dec 02 08:23:31 2020 +0100
+++ b/mercurial/upgrade.py	Mon Nov 30 14:07:23 2020 +0100
@@ -742,9 +742,9 @@
             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 @@
         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 @@
         printrequirements()
         printoptimisations()
         printupgradeactions()
+        print_affected_revlogs()
 
         unusedoptimize = [i for i in alloptimizations if i not in actions]
 
@@ -1409,6 +1419,7 @@
     printrequirements()
     printoptimisations()
     printupgradeactions()
+    print_affected_revlogs()
 
     upgradeactions = [a.name for a in actions]
 
--- a/tests/test-copies-chain-merge.t	Wed Dec 02 08:23:31 2020 +0100
+++ b/tests/test-copies-chain-merge.t	Mon Nov 30 14:07:23 2020 +0100
@@ -664,6 +664,11 @@
      preserved: * (glob)
      added: exp-copies-sidedata-changeset, exp-sidedata-flag
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
 #endif
 
 
--- a/tests/test-lfs-serve.t	Wed Dec 02 08:23:31 2020 +0100
+++ b/tests/test-lfs-serve.t	Mon Nov 30 14:07:23 2020 +0100
@@ -133,6 +133,11 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
 
   $ grep 'lfs' .hg/requires $SERVER_REQUIRES
   [1]
--- a/tests/test-persistent-nodemap.t	Wed Dec 02 08:23:31 2020 +0100
+++ b/tests/test-persistent-nodemap.t	Mon Nov 30 14:07:23 2020 +0100
@@ -492,6 +492,11 @@
      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 @@
      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 @@
   
   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
--- a/tests/test-share-safe.t	Wed Dec 02 08:23:31 2020 +0100
+++ b/tests/test-share-safe.t	Mon Nov 30 14:07:23 2020 +0100
@@ -215,6 +215,11 @@
      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 @@
      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 @@
      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 @@
      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 @@
      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 @@
      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
--- a/tests/test-upgrade-repo.t	Wed Dec 02 08:23:31 2020 +0100
+++ b/tests/test-upgrade-repo.t	Mon Nov 30 14:07:23 2020 +0100
@@ -179,6 +179,11 @@
   requirements
      preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
   additional optimizations are available by specifying "--optimize <name>":
   
   re-delta-parent
@@ -198,6 +203,11 @@
   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 @@
   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 <name>":
   
   re-delta-multibase
@@ -239,6 +254,11 @@
   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 <name>":
   
   re-delta-multibase
@@ -256,6 +276,11 @@
   
   optimisations: re-delta-parent
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
 
 unknown optimization:
 
@@ -357,6 +382,11 @@
   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 <name>":
   
   re-delta-parent
@@ -376,6 +406,11 @@
      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 @@
   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 <name>":
   
   re-delta-parent
@@ -436,6 +476,11 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   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 @@
      preserved: dotencode, fncache, generaldelta, revlogv1, store
      added: sparserevlog
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
   $ cat .hg/requires
   dotencode
   fncache
@@ -1277,6 +1385,11 @@
      preserved: dotencode, fncache, generaldelta, revlogv1, store
      removed: sparserevlog
   
+  processed revlogs:
+    - all-filelogs
+    - changelog
+    - manifest
+  
   $ cat .hg/requires
   dotencode
   fncache
@@ -1298,6 +1411,11 @@
      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 @@
      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 @@
      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 @@
      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 @@
      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 @@
      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