perf: quiet stderr output in perf::unbundle
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 25 Aug 2022 05:10:55 +0200
changeset 49443 2896ed067d51
parent 49442 816236523765
child 49444 52f31b660d38
perf: quiet stderr output in perf::unbundle There a lot of repetitive transaction message we do not care about.
contrib/perf.py
tests/test-contrib-perf.t
--- a/contrib/perf.py	Tue Aug 23 17:31:27 2022 -0400
+++ b/contrib/perf.py	Thu Aug 25 05:10:55 2022 +0200
@@ -2668,9 +2668,13 @@
 
     with repo.lock():
         bundle = [None, None]
+        orig_quiet = repo.ui.quiet
         try:
             with open(fname, mode="rb") as f:
 
+                def noop_report(*args, **kwargs):
+                    pass
+
                 def setup():
                     gen, tr = bundle
                     if tr is not None:
@@ -2679,6 +2683,7 @@
                     f.seek(0)
                     bundle[0] = exchange.readbundle(ui, f, fname)
                     bundle[1] = repo.transaction(b'perf::unbundle')
+                    bundle[1]._report = noop_report  # silence the transaction
 
                 def apply():
                     gen, tr = bundle
--- a/tests/test-contrib-perf.t	Tue Aug 23 17:31:27 2022 -0400
+++ b/tests/test-contrib-perf.t	Thu Aug 25 05:10:55 2022 +0200
@@ -398,8 +398,6 @@
   adding changesets
   adding manifests
   adding file changes
-  transaction abort!
-  rollback completed
 
 
 test  profile-benchmark option