emitrevision: add a small closure to check if a base is usable
We will make more use of this and make it more complex too.
chg: scale the timeout in test with the rest
This should avoid some flakiness where the logs reports server shutting down.
hghave: we might need py310 and py311 at some point
Some tests are already showing slightly different results on Python 3.11. The
better idea would be to make them more portable, but if that's not possible,
now we can use hghave detection for certain lines.
I wonder if there will ever be Python 31.0 and 31.1 though.
hghave: detect Python 3.10 and 3.11 as well
Noticed because test-contrib-relnotes.t was skipped.
extensions: load help from hgext.__index__ as a fallback this time
Prior to
843418dc0b1b, `hgext.__index__` was consulted first if present, which
caused the longer help from the extension modules to be ignored, even when
available. But that change causes a bunch of test failures when the pyoxidized
binary bundles *.pyc in the binary, saying the there's no help topic for
`hg help $disabled_extension` and suggesting the use of `--keyword`, rather than
showing a summary and indicating that it is disabled. Current failures were in
test-check-help.t, test-extension.t, test-help.t, and test-qrecord.t.
Ideally, we would read the various *.pyc files from memory and slurp in the
docstring, but I know that they used to not be readable as resources, and I
can't figure out how to make it work now. So maybe 3.9 and/or the current
PyOxidizer doesn't support it yet. I got closer in py2exe with
`importlib.resources.open_binary("hgext", "rebase.pyc")`, but `open_binary()` on
*.pyc fails in pyoxidizer.[1] Either way, the *.pyc can't be passed to
`ast.parse()` as `extensions._disabledcmdtable()` is doing, so I'm setting that
aside for now.
[1] https://github.com/indygreg/PyOxidizer/issues/649
extensions: process disabled external paths when `hgext` package is in-memory
This fixes `hg help -e ambiguous` in test-helpt.t:2055 with the
`ambiguous = !./ambiguous.py` configuration, when `hgext` is not in the
filesystem (e.g. pyoxidizer builds with in-memory resources, or TortoiseHg with
py2exe), but the disabled external extension is. Now instead of aborting with a
suggestion to try `--keyword`, the help command prints text for the extension.