typing: add type hints to mercurial/help.py
Was hoping to find more issues like
f09bc2ed9100, but it may be that nothing
checks the args to that operation. In any event, the work is done and pytype
doesn't do a very good job inferring the types. A few of th emore complicated
things like the command table are left untyped, because they come from modules
that aren't typed yet.
match: make the FLAG_RE pattern a raw string
PyCharm was complaining about invalid escape sequences since this was added
recently in
3eda36e9b3d6.
configitems: add a default value for "merge-tools.xxx.regappend"
When trying to figure out how `hg help -v` took the Set interpolation path in
f09bc2ed9100, I turned on devel warnings and noticed this (unrelated) warning:
devel-warn: specifying a mismatched default value for a registered config
item: 'merge-tools.beyondcompare4.regappend' ''
at: c:\Users\Matt\hg\mercurial\filemerge.py:46 (_toolstr)
The previous default value for this config was `None`, but that slightly
complicates the code at the only site it is used, referenced above.
attr: vendor 22.1.0
The previous version was 5 years old, and pytype 2022.06.30 started complaining
about various uses (e.g. seeing `mercurial.thirdparty.attr._make._CountingAttr`
instead of `bytearray`). Hopefully this helps. Additionally, this has official
python 3.11 support.
The `attrs` package is left out, because it is simply a bunch of *.pyi stubs and
`from attr.X import *`, and that's not how they've been used up to this point.
We'd probably need to customize those anyway to
`from mercurial.thirdparty.attr import *`.