diff hgext/narrow/narrowbundle2.py @ 47445:86418ad637d1

narrowbundle: use new context manager for silencing the ui Same reasoning as the previous change. This affects a few tests because of the hack from d7304434390f (changegroup: move message about added changes to transaction summary, 2019-09-08). Differential Revision: https://phab.mercurial-scm.org/D10886
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 18 Jun 2021 16:03:42 -0700
parents d55b71393907
children 6000f5b25c9b
line wrap: on
line diff
--- a/hgext/narrow/narrowbundle2.py	Fri Jun 18 16:00:58 2021 -0700
+++ b/hgext/narrow/narrowbundle2.py	Fri Jun 18 16:03:42 2021 -0700
@@ -281,10 +281,10 @@
     try:
         gen = exchange.readbundle(ui, f, chgrpfile, vfs)
         # silence internal shuffling chatter
-        override = {(b'ui', b'quiet'): True}
-        if ui.verbose:
-            override = {}
-        with ui.configoverride(override):
+        maybe_silent = (
+            ui.silent() if not ui.verbose else util.nullcontextmanager()
+        )
+        with maybe_silent:
             if isinstance(gen, bundle2.unbundle20):
                 with repo.transaction(b'strip') as tr:
                     bundle2.processbundle(repo, gen, lambda: tr)