diff mercurial/upgrade_utils/auto_upgrade.py @ 49341:b38f5063a0c6

auto-upgrade: add an option to silence the dirstate-v2 message For well tested case, the message can get in the way, so we add a way to disable it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 14 Jun 2022 15:19:45 +0200
parents 1b9114709428
children 67b210bb5ce2
line wrap: on
line diff
--- a/mercurial/upgrade_utils/auto_upgrade.py	Tue Jun 14 15:17:51 2022 +0200
+++ b/mercurial/upgrade_utils/auto_upgrade.py	Tue Jun 14 15:19:45 2022 +0200
@@ -153,6 +153,10 @@
         b'format',
         b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories',
     )
+    auto_upgrade_dv2_quiet = ui.configbool(
+        b'format',
+        b'use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet',
+    )
 
     action = None
 
@@ -169,7 +173,7 @@
             )
 
             def action():
-                if not ui.quiet:
+                if not (ui.quiet or auto_upgrade_dv2_quiet):
                     ui.write_err(msg)
                     ui.write_err(hint)
                 requirements.add(requirementsmod.DIRSTATE_V2_REQUIREMENT)
@@ -186,7 +190,7 @@
             )
 
             def action():
-                if not ui.quiet:
+                if not (ui.quiet or auto_upgrade_dv2_quiet):
                     ui.write_err(msg)
                     ui.write_err(hint)
                 requirements.discard(requirementsmod.DIRSTATE_V2_REQUIREMENT)