Wed, 10 Jul 2024 18:34:47 -0400 typing: add a few trivial type hints to `mercurial/templater.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:34:47 -0400] rev 51678
typing: add a few trivial type hints to `mercurial/templater.py` Since hg 3dbc7b1ecaba, pytype started inferring that the second value in the tuple is `BinaryIO`, but still hasn't been able to figure out the rest of `open_template()`. We can be more precise.
Wed, 10 Jul 2024 18:19:32 -0400 typing: add a few type hints to `mercurial/revlog.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:19:32 -0400] rev 51677
typing: add a few type hints to `mercurial/revlog.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype stopped being able to infer the type for `_docket_file` and `compress()`. Lock those types in before they get lost.
Wed, 10 Jul 2024 18:05:40 -0400 typing: add a trivial type hint to `mercurial/posix.py` to avoid an @overload
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 18:05:40 -0400] rev 51676
typing: add a trivial type hint to `mercurial/posix.py` to avoid an @overload Since hg 3dbc7b1ecaba, pytype added an `@overload` for this function, without a type on the parameter. That's wrong, and undermines the hints on the non-trivial functions.
Wed, 10 Jul 2024 17:55:14 -0400 typing: add some trivial type hints to `mercurial/match.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:55:14 -0400] rev 51675
typing: add some trivial type hints to `mercurial/match.py` These were new methods since hg 3dbc7b1ecaba, but surprisingly pytype couldn't figure them out.
Wed, 10 Jul 2024 17:44:49 -0400 typing: add a type hint to `mercurial/hg.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:44:49 -0400] rev 51674
typing: add a type hint to `mercurial/hg.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, the first value of the tuple changed from bytes to str. Let's lock this in, so that pytype flags it if someone mistakenly adds a tuple with bytes somewhere.
Wed, 10 Jul 2024 17:37:35 -0400 typing: restore `encoding.encoding` and `encoding.encodingmode` to bytes
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:37:35 -0400] rev 51673
typing: restore `encoding.encoding` and `encoding.encodingmode` to bytes Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype determined the signature of these fields changed from `bytes` to `Any`. Not sure why- the type of `environ` then and now is: `Union[WindowsEnviron, Dict[bytes, bytes], os._Environ[bytes]]` That said, PyCharm wasn't able to figure out the type of `environ`, and the `WindowsEnviron` class extends `MutableMapping` without specifying bytes for the key and value types in py3.9. But that's not changed in my setup, so I can't explain it.
Wed, 10 Jul 2024 17:16:19 -0400 typing: add some trivial type hints to `mercurial/bundlecaches.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:16:19 -0400] rev 51672
typing: add some trivial type hints to `mercurial/bundlecaches.py` The function is meant for extensions, but it wasn't obvious what was expected without looking through the code. Also, pytype couldn't figure it out either.
Wed, 10 Jul 2024 17:09:34 -0400 typing: add some type hints for bundle2 capabilities
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 17:09:34 -0400] rev 51671
typing: add some type hints for bundle2 capabilities Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, pytype determined the signature of `bundle20.capabilities` changed from `Dict[bytes, Tuple[bytes]]` to `Dict[bytes, Union[List[bytes], Tuple[bytes]]]`. First, I did try to simply be explicit about the previously inferred type, but it does seem to mix and match list/tuple now (e.g. in `writenewbundle()`). I tried changing the new list usage to tuple, but a couple of things complained, (and I think lists of one item are a little more clear to read anyway). So then I typed the dict value as `Sequence[bytes]`, which worked fine. But there's also a module level `capabilities` field, and when that's typed, pytype complains about `Sequence[bytes]` lacking `__add__`[1]. So I gave up, and just assigned it the type it wanted, with an alias. If somebody feels motivated to make the type consistent, it's simple enough to change the alias. The mutable default value to the constructor was removed to appease PyCharm's type checking on the field. (I didn't bother running the code through pytype prior to changing it, because we've previously made an effort to remove this pattern anyway.) I'm not sure why `getrepocaps()` has a default value for `role` that apparently raises an exception. It's just flagged for now so this series can land without risking additional problems. [1] https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/2466903
Wed, 10 Jul 2024 16:04:53 -0400 typing: add a few type hints to `mercurial/utils/urlutil.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 16:04:53 -0400] rev 51670
typing: add a few type hints to `mercurial/utils/urlutil.py` Somewhere between hg 3dbc7b1ecaba and hg 8e3f6b5bf720, `_pathsuboptions` changed from `Dict[bytes, Tuple[bytes, Any]]` to `Dict[bytes, Tuple[str, Any]]`, and it caught my attention from diffing the local *.pyi files. The change is correct based on the assertion, so let's get pytype to check for this instead of relying on the assertion alone.
Wed, 10 Jul 2024 15:49:16 -0400 typing: add type hints to `mercurial/utils/resourceutil.py`
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jul 2024 15:49:16 -0400] rev 51669
typing: add type hints to `mercurial/utils/resourceutil.py` The `except` path requires byte args (because of the byte based manipulation in `_package_path()`), while the `else` case tolerates `AnyStr`. Pytype was unable to figure this out, and we should make sure the interface is the same for all environments.
Fri, 12 Jul 2024 15:29:35 +0400 copyright: update to 2024 stable
Anton Shestakov <av6@dwimlabs.net> [Fri, 12 Jul 2024 15:29:35 +0400] rev 51668
copyright: update to 2024
Mon, 08 Jul 2024 17:56:54 +0200 branching: merge stable into default for 6.9 cycle
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:56:54 +0200] rev 51666
branching: merge stable into default for 6.9 cycle
Mon, 08 Jul 2024 17:52:08 +0200 Added signature for changeset 11f41248595b stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:52:08 +0200] rev 51665
Added signature for changeset 11f41248595b
Mon, 08 Jul 2024 17:51:56 +0200 Added tag 6.8 for changeset 11f41248595b stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:51:56 +0200] rev 51664
Added tag 6.8 for changeset 11f41248595b
Mon, 08 Jul 2024 17:51:04 +0200 relnotes: add 6.8 stable 6.8
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 17:51:04 +0200] rev 51663
relnotes: add 6.8
Mon, 08 Jul 2024 16:44:07 +0200 test-check: don't report distutils as a local import stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 16:44:07 +0200] rev 51662
test-check: don't report distutils as a local import On python 3.12 this is wrongly reported as a local import. So we adjust the checker to avoid it.
Mon, 08 Jul 2024 16:20:04 +0200 Backed out changeset f28c52a9f7b4 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:20:04 +0200] rev 51661
Backed out changeset f28c52a9f7b4 This backout and the previous are due to a large performance regression detected in repositories with a lot of obsmarkers when performing a clone. A better fix will come along at the start of the next cycle.
Mon, 08 Jul 2024 16:19:33 +0200 Backed out changeset ff523675cd69 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:19:33 +0200] rev 51660
Backed out changeset ff523675cd69
Mon, 08 Jul 2024 16:02:54 +0200 rust: use `cpython` 0.7.2 crate to add support for Python 3.12 stable
Raphaël Gomès <rgomes@octobus.net> [Mon, 08 Jul 2024 16:02:54 +0200] rev 51659
rust: use `cpython` 0.7.2 crate to add support for Python 3.12 This will give us more headroom until we can migrate to PyO3 some day.
Mon, 08 Jul 2024 15:52:01 +0200 revbranchcache: disable mmap access by default stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Mon, 08 Jul 2024 15:52:01 +0200] rev 51658
revbranchcache: disable mmap access by default The revbranchcache can be truncated (if some part of it is detected as invalid). Using mmap on file we truncate is not an option at access to truncated part would result in a SIGBUS signal. So we disable the mmap by default until we fix this issue.
Mon, 24 Jun 2024 18:54:59 +0200 portability: fix build on Solaris-derived systemd stable
Joerg Sonnenberger <joerg@bec.de> [Mon, 24 Jun 2024 18:54:59 +0200] rev 51657
portability: fix build on Solaris-derived systemd Current Illumos and older Solaris require _XOPEN_SOURCE for msg_control. O_DIRECTORY doesn't exist on older systems either, so fallback to O_RDONLY. It's good enough as a repository will require both R and X permission anyway.
Wed, 03 Jul 2024 12:32:57 +0200 mmap: only use mmap to read revlog persistent nodemap if it is safe stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:32:57 +0200] rev 51656
mmap: only use mmap to read revlog persistent nodemap if it is safe Cf `is_mmap_safe` docstring.
Wed, 03 Jul 2024 12:47:08 +0200 mmap: fix another instance of reverse mmap logic in persistent nodemap stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:47:08 +0200] rev 51655
mmap: fix another instance of reverse mmap logic in persistent nodemap This fix the same kind of issue as 85d96517e650
Wed, 03 Jul 2024 12:31:21 +0200 mmap: only use mmap to read rev-branch-cache data if it is safe stable
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 03 Jul 2024 12:31:21 +0200] rev 51654
mmap: only use mmap to read rev-branch-cache data if it is safe Cf `is_mmap_safe` docstring.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 tip