repo-upgrade: write new requirement before upgrading the dirstate
This will prevent a small race condition where another hg process still
believes the repo is dirstate-v1 during the upgrade process.
This is good to have, but it is not a proper fix for the underlying problem.
There is code that assumes a requirement means a usage, e.g. having the
`generaldelta` requirement would imply *all* revlogs to use general delta,
but it's not true, it simply means that the repository advertises to the
client it needs to understand `generaldelta` in order to read the repo.
In the case of the dirstate, having the requirement *technically* should always
be the same as using dirstate-v2, since there is only one dirstate and
requirements should be as minimal as possible. However, we should not assume
this and make the code more robust in a future patch (series).
[build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 80
exclude = '''
build/
| wheelhouse/
| dist/
| packages/
| \.hg/
| \.mypy_cache/
| \.venv/
| mercurial/thirdparty/
'''
skip-string-normalization = true
quiet = true