upgrade: issue a message when a revlog type has to be upgraded
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 06 Dec 2021 17:13:26 +0100
changeset 48447 8405c1bffacf
parent 48446 1d0978cfe968
child 48448 62e6222cc5b6
upgrade: issue a message when a revlog type has to be upgraded This is more explicite and prepare for a smoother transition to smarter picking of the revlog we will process. Differential Revision: https://phab.mercurial-scm.org/D11870
mercurial/upgrade.py
tests/test-upgrade-repo.t
--- a/mercurial/upgrade.py	Mon Dec 06 17:12:21 2021 +0100
+++ b/mercurial/upgrade.py	Mon Dec 06 17:13:26 2021 +0100
@@ -92,7 +92,8 @@
 
     touched_revlogs = set()
     overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n')
-    msg_issued = False
+    select_msg = _(b'note:    selecting %s for processing to change: %s\n')
+    msg_issued = 0
 
     FL = upgrade_engine.UPGRADE_FILELOGS
     MN = upgrade_engine.UPGRADE_MANIFEST
@@ -108,24 +109,43 @@
                 if not specified_revlogs[FL]:
                     msg = overwrite_msg % (b'--no-filelogs', action.name)
                     ui.warn(msg)
-                    msg_issued = True
+                    msg_issued = 2
+            else:
+                msg = select_msg % (b'all-filelogs', action.name)
+                ui.status(msg)
+                if not ui.quiet:
+                    msg_issued = 1
             touched_revlogs.add(FL)
+
         if action.touches_manifests and MN not in touched_revlogs:
             if MN in specified_revlogs:
                 if not specified_revlogs[MN]:
                     msg = overwrite_msg % (b'--no-manifest', action.name)
                     ui.warn(msg)
-                    msg_issued = True
+                    msg_issued = 2
+            else:
+                msg = select_msg % (b'all-manifestlogs', action.name)
+                ui.status(msg)
+                if not ui.quiet:
+                    msg_issued = 1
             touched_revlogs.add(MN)
+
         if action.touches_changelog and CL not in touched_revlogs:
             if CL in specified_revlogs:
                 if not specified_revlogs[CL]:
                     msg = overwrite_msg % (b'--no-changelog', action.name)
                     ui.warn(msg)
                     msg_issued = True
+            else:
+                msg = select_msg % (b'changelog', action.name)
+                ui.status(msg)
+                if not ui.quiet:
+                    msg_issued = 1
             touched_revlogs.add(CL)
-    if msg_issued:
+    if msg_issued >= 2:
         ui.warn((b"\n"))
+    elif msg_issued >= 1:
+        ui.status((b"\n"))
 
     revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
     if specified_revlogs:
--- a/tests/test-upgrade-repo.t	Mon Dec 06 17:12:21 2021 +0100
+++ b/tests/test-upgrade-repo.t	Mon Dec 06 17:13:26 2021 +0100
@@ -401,6 +401,10 @@
   [formatvariant.name.mismatchdefault|compression:       ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special|   zlib][formatvariant.default|    zstd] (zstd !)
   [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
   $ hg debugupgraderepo
+  note:    selecting all-filelogs for processing to change: dotencode
+  note:    selecting all-manifestlogs for processing to change: dotencode
+  note:    selecting changelog for processing to change: dotencode
+  
   repository lacks features recommended by current config options:
   
   fncache
@@ -473,6 +477,10 @@
   
 
   $ hg --config format.dotencode=false debugupgraderepo
+  note:    selecting all-filelogs for processing to change: fncache
+  note:    selecting all-manifestlogs for processing to change: fncache
+  note:    selecting changelog for processing to change: fncache
+  
   repository lacks features recommended by current config options:
   
   fncache
@@ -567,6 +575,10 @@
   .hg/store/data/f2.i
 
   $ hg debugupgraderepo --run --config format.sparse-revlog=false
+  note:    selecting all-filelogs for processing to change: generaldelta
+  note:    selecting all-manifestlogs for processing to change: generaldelta
+  note:    selecting changelog for processing to change: generaldelta
+  
   upgrade will perform the following actions:
   
   requirements
@@ -671,6 +683,10 @@
 
   $ rm -rf .hg/upgradebackup.*/
   $ hg debugupgraderepo --run --no-backup
+  note:    selecting all-filelogs for processing to change: sparserevlog
+  note:    selecting all-manifestlogs for processing to change: sparserevlog
+  note:    selecting changelog for processing to change: sparserevlog
+  
   upgrade will perform the following actions:
   
   requirements
@@ -961,6 +977,9 @@
     - manifest
   
   $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
+  note:    selecting all-filelogs for processing to change: sparserevlog
+  note:    selecting changelog for processing to change: sparserevlog
+  
   ignoring revlogs selection flags, format requirements change: sparserevlog
   upgrade will perform the following actions:
   
@@ -1016,6 +1035,9 @@
 
   $ echo "sparse-revlog=yes" >> .hg/hgrc
   $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
+  note:    selecting all-filelogs for processing to change: sparserevlog
+  note:    selecting changelog for processing to change: sparserevlog
+  
   ignoring revlogs selection flags, format requirements change: sparserevlog
   upgrade will perform the following actions: