schemes: fix a broken check for drive letter conflicts
Flagged by pytype locally. It appears to have regressed in
1863584f2fba (not
yet released).
This seems like an obvious typo- `dict.isalpha()` is nonsense. There's no crash
though because `schemes` is pre-populated with 5 schemes (that are all now
defunct), so the length of the dict is never 1, so it's impossible to abort.
typing: suppress a bunch of potential import-error cases in extensions
As flagged by pytype locally. Either the ImportError is locally handled, or the
imported module was previously determined to be present by `hgave` (for the
phabricator extension), or is handled by the `hgext.convert.subversion` module
when imported (for the `hgext.convert.transport` module).
watchman: drop some py2 compat code
The `unicode` reference was being flagged by pytype, even though it was never
evaluated on py3. There's more that can be dropped and `compat.py` can probably
be inlined if we don't care about minimizing the code changes from FB. But I
don't feel like dealing with that.
pytype: add coverage for hgdemandimport
This would have flagged what needed fixing in
48e38b179106 long ago.
hgweb: skip body creation of HEAD for most requests
The body is thrown away anyway, so this just wastes a lot of CPU time.
In the case of /archive/, this skips manifest processing and the actual
file archiving, resulting in a huge difference.
The most tricky part here is skipping the Content-Length creation as it
would indicate the output size for the corresponding GET request.