createrepository: allow to directly pass the target requirements
This is useful when doing a local clone that copies store contents, it will
requires the destination to use the very same store requirements so directly
providing them will be simpler and safer
Differential Revision: https://phab.mercurial-scm.org/D10848
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
debugbackupbundle: use new context manager for silencing the ui
A difference between setting `ui.quiet` and using `ui.silent()` is
that the latter also silences `ui.write()` calls. That's practically
always what one wants, including here, I think.
Differential Revision: https://phab.mercurial-scm.org/D10885
ui: add a context manager for silencing the ui (pushbuffer+popbuffer)
We often silence the ui by calling `ui.pushbuffer()` followed (a later
in the code) by `ui.popbuffer()`. These places can be identified by
the fact that they ignore the output returned from
`ui.popbuffer()`. Let's create a context manager for these cases, to
avoid repetition, and to avoid accidentally leaving the ui silent on
exceptions. I deliberately called the new function `silent()` instead
of `buffered()`, because it's just an implementation detail that it
uses `pushbuffer()` and `popbuffer()`. We could later optimize it to
not buffer the output.
Differential Revision: https://phab.mercurial-scm.org/D10884