diff mercurial/upgrade_utils/auto_upgrade.py @ 49342:67b210bb5ce2

auto-upgrade: add an option to silence the tracked-hint 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:22:05 +0200
parents b38f5063a0c6
children 1c5810ce737e
line wrap: on
line diff
--- a/mercurial/upgrade_utils/auto_upgrade.py	Tue Jun 14 15:19:45 2022 +0200
+++ b/mercurial/upgrade_utils/auto_upgrade.py	Tue Jun 14 15:22:05 2022 +0200
@@ -101,6 +101,10 @@
         b'format',
         b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories',
     )
+    auto_upgrade_quiet = ui.configbool(
+        b'format',
+        b'use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet',
+    )
 
     action = None
 
@@ -115,7 +119,7 @@
             hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n"
 
             def action():
-                if not ui.quiet:
+                if not (ui.quiet or auto_upgrade_quiet):
                     ui.write_err(msg)
                     ui.write_err(hint)
                 requirements.add(requirementsmod.DIRSTATE_TRACKED_HINT_V1)
@@ -130,7 +134,7 @@
             hint = b"(see `hg help config.format.use-dirstate-tracked-hint` for details)\n"
 
             def action():
-                if not ui.quiet:
+                if not (ui.quiet or auto_upgrade_quiet):
                     ui.write_err(msg)
                     ui.write_err(hint)
                 requirements.discard(requirementsmod.DIRSTATE_TRACKED_HINT_V1)