diff mercurial/upgrade.py @ 46035:6c960b708ac4

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 30 Nov 2020 14:07:23 +0100
parents c6a1fa42e325
children f105c49e89cd
line wrap: on
line diff
--- 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]