matcher: fix issues regex flag contained in pattern (
issue6759)
Python 3.11 is now enforcing that flag must be at the beginning of the regex
This creates a serious regression for people using Python 3.11 with an hgignore
using flag in a "relre" pattern.
We now detect any flags in such pattern and "prepend" our ".*" pattern after them.
In addition, we now insert the flag in the regexp to only affect the pattern we
are rewriting. Otherwise, the regex built from the combined pattern would these
flags in the middle of it anyway.
As a side effect of this last change, we fix a bug… before this change regex
flag in a pattern would affect all combined patterns. That was bad and is not
longer the case.
The Rust code needs to be updated to fix that very bug, but we will do it in
another changeset.
release: removed the 6.3.0 tag
The revision having two tags confuses some of the build script trying to fetch
the version. So, remove the "bad" tag for now.
cffi: fix a bytes vs str issue on macOS when listing directories
This code hasn't been touched in recent years, and the other implementation
return bytes for the filename, so I assume this is a holdover from the py2 days.
I was unable to test it on mac though, because the `_osutil` import failed.
typing: fix the typehint for `skip` arg on `osutil.listdir()` to be optional
The cffi and pure implementations both default to `None`, and the args are
parsed in C with `"y#|OO:listdir"`, with the C variable initialized to NULL.
typing: add type hints to mpatch implementations
Again, using `merge-pyi` to apply the stubs in cext and then manually type the
private methods. The generated stub without these hints inferred very little,
and the stuff it did was wrong.
typing: add type hints to bdiff implementations
Not super important code, but this was an exercise in using `merge-pyi` to fold
type stubs back into the code on something small. The cext stubs don't seem to
be getting used (at least the only thing in `.pytype/pyi/mercurial/cext` after a
run generating the stubs is `__init__.pyi`), so maybe this will help some.