Mercurial > hg-stable
comparison contrib/perf.py @ 49469:2896ed067d51
perf: quiet stderr output in perf::unbundle
There a lot of repetitive transaction message we do not care about.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 25 Aug 2022 05:10:55 +0200 |
parents | 44d4fd09982f |
children | 52f31b660d38 |
comparison
equal
deleted
inserted
replaced
49468:816236523765 | 49469:2896ed067d51 |
---|---|
2666 from mercurial import exchange | 2666 from mercurial import exchange |
2667 from mercurial import bundle2 | 2667 from mercurial import bundle2 |
2668 | 2668 |
2669 with repo.lock(): | 2669 with repo.lock(): |
2670 bundle = [None, None] | 2670 bundle = [None, None] |
2671 orig_quiet = repo.ui.quiet | |
2671 try: | 2672 try: |
2672 with open(fname, mode="rb") as f: | 2673 with open(fname, mode="rb") as f: |
2674 | |
2675 def noop_report(*args, **kwargs): | |
2676 pass | |
2673 | 2677 |
2674 def setup(): | 2678 def setup(): |
2675 gen, tr = bundle | 2679 gen, tr = bundle |
2676 if tr is not None: | 2680 if tr is not None: |
2677 tr.abort() | 2681 tr.abort() |
2678 bundle[:] = [None, None] | 2682 bundle[:] = [None, None] |
2679 f.seek(0) | 2683 f.seek(0) |
2680 bundle[0] = exchange.readbundle(ui, f, fname) | 2684 bundle[0] = exchange.readbundle(ui, f, fname) |
2681 bundle[1] = repo.transaction(b'perf::unbundle') | 2685 bundle[1] = repo.transaction(b'perf::unbundle') |
2686 bundle[1]._report = noop_report # silence the transaction | |
2682 | 2687 |
2683 def apply(): | 2688 def apply(): |
2684 gen, tr = bundle | 2689 gen, tr = bundle |
2685 bundle2.applybundle( | 2690 bundle2.applybundle( |
2686 repo, | 2691 repo, |