Fri, 18 Jun 2021 16:00:58 -0700 debugbackupbundle: use new context manager for silencing the ui
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jun 2021 16:00:58 -0700] rev 47444
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
Fri, 18 Jun 2021 15:48:51 -0700 ui: add a context manager for silencing the ui (pushbuffer+popbuffer)
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jun 2021 15:48:51 -0700] rev 47443
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
Fri, 18 Jun 2021 14:17:43 -0700 shelve: don't swallow errors that happen when reverting the working copy
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jun 2021 14:17:43 -0700] rev 47442
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
Fri, 18 Jun 2021 13:55:45 -0700 histedit: don't swallow errors that happen when updating the working copy
Martin von Zweigbergk <martinvonz@google.com> [Fri, 18 Jun 2021 13:55:45 -0700] rev 47441
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
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -4 +4 +10 +30 +100 +300 +1000 +3000 tip