diff mercurial/upgrade.py @ 46213:30310886d423

upgrade: introduce post upgrade and downgrade message for improvements For certain imporvements, we will like to show a message after the operation completed. This patch introduces that functionality. Right now it's only used by share-safe feature. Differential Revision: https://phab.mercurial-scm.org/D9619
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 16 Dec 2020 14:00:41 +0530
parents 6b40aac4da8e
children 0ca98ed828f9
line wrap: on
line diff
--- a/mercurial/upgrade.py	Wed Dec 16 15:04:17 2020 +0530
+++ b/mercurial/upgrade.py	Wed Dec 16 14:00:41 2020 +0530
@@ -87,6 +87,7 @@
     up_actions = upgrade_actions.determine_upgrade_actions(
         repo, format_upgrades, optimizations, repo.requirements, newreqs
     )
+    removed_actions = upgrade_actions.find_format_downgrades(repo)
 
     removedreqs = repo.requirements - newreqs
     addedreqs = newreqs - repo.requirements
@@ -108,6 +109,7 @@
         newreqs,
         repo.requirements,
         up_actions,
+        removed_actions,
         revlogs,
     )
 
@@ -226,20 +228,4 @@
                     )
                 )
 
-            if upgrade_actions.sharesafe.name in addedreqs:
-                ui.warn(
-                    _(
-                        b'repository upgraded to share safe mode, existing'
-                        b' shares will still work in old non-safe mode. '
-                        b'Re-share existing shares to use them in safe mode'
-                        b' New shares will be created in safe mode.\n'
-                    )
-                )
-            if upgrade_actions.sharesafe.name in removedreqs:
-                ui.warn(
-                    _(
-                        b'repository downgraded to not use share safe mode, '
-                        b'existing shares will not work and needs to'
-                        b' be reshared.\n'
-                    )
-                )
+            upgrade_op.print_post_op_messages()