Mercurial > hg
view black.toml @ 43849:63bb6dc62f24 stable
remotefilelog: add a developer option to wait for background processes
In order to block the main command on the subprocess exiting, we ensure the
repo's ui object will call the subprocess.wait() method to ensure the top-level
hg process doesn't exit until all background processes have also done so.
Currently, in the tests, most operation spawning background process as followed
by commands waiting for these operations to complete. However this waiting is
racy. First because it seems like we can start waiting before the background
operation actually start, in which case it is prematurely detected as "done".
Second, because some commands may spawn multiple background operation for the
same operation (eg: rebase can apparently trigger multiple prefetch). The
current approach could be updated to maybe handle the first issue, but the
second one will never be properly handled.
In most case, we do not care that the bg process keep running after the command
end. (Since we explicitly wait for them to end before doing anything else). So
we add an option to wait on the background process before exiting the command.
We'll put it in use in the next changeset.
Differential Revision: https://phab.mercurial-scm.org/D7585
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 09 Dec 2019 09:54:27 +0100 |
parents | 2247bf3cec76 |
children | 5e84a96d865b |
line wrap: on
line source
[tool.black] line-length = 80 exclude = ''' build/ | wheelhouse/ | dist/ | packages/ | \.hg/ | \.mypy_cache/ | \.venv/ | mercurial/thirdparty/ | contrib/python-zstandard/ ''' skip-string-normalization = true quiet = true