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
shelve: don't swallow errors that happen when reverting the working copy
Same reasoning as the parent commit. The code in question here comes
from
fb8065de47b0 (unshelve: silence internal revert, 2014-08-15),
which says that it was to prepare for some upcoming revert changes. I
suppose those changes have happened by now but we fixed something
about it, because I don't see any unwanted changes in tests (no
changes at all in tests, in fact).
Differential Revision: https://phab.mercurial-scm.org/D10883
histedit: don't swallow errors that happen when updating the working copy
Commit
34165875fa5d (histedit: limit updated and merging output to
important updates, 2016-02-03) added a call to
`ui.pushbuffer(labeled=True, errors=True)`. I don't know if there was
a reason for the `errors=True` (nor the `labeled=True` bit, which I
removed in the previous commit). It seems bad to just discard the
errors, so let's not do that. By not doing that, we can also remove a
workaround for the lack of errors from `test-removeemptydirs.t`.
Differential Revision: https://phab.mercurial-scm.org/D10882
histedit: don't record labels for output that we will discard
Differential Revision: https://phab.mercurial-scm.org/D10881
dog-raft: work with str-keyed opts throughout
Differential Revision: https://phab.mercurial-scm.org/D10864
cmdutil: make resolvecommitoptions() work on str-keyed opts
As with `checknotesize()`, I also changed to snake_case while at it,
to help extensions a little.
Differential Revision: https://phab.mercurial-scm.org/D10863
cmdutil: make amend() take str-keyed opts
I couldn't think of a reasonable change to the signature here, so
unfortunately it keeps the existing one.
Differential Revision: https://phab.mercurial-scm.org/D10862
commit: keep opts dict str-keyed a bit longer
Differential Revision: https://phab.mercurial-scm.org/D10861
dog-raft: keep opts dict str-keyed a bit longer
Differential Revision: https://phab.mercurial-scm.org/D10860