Mercurial > hg
view .gitlab/merge_request_templates/Default.md @ 51872:5e79783d4bc7
revlog: make `clearcaches()` signature consistent with ManifestRevlog
I'm not sure if this a newly added bug, because of using a different version of
pytype, or if the recent work around avoiding the zope interface types in the
type checking phase (see 5eb98ea78fd7 and friends)... but pytype 2023.11.21
started flagging this series since it was last pushed ~6 weeks ago:
File "/mnt/c/Users/Matt/hg/mercurial/bundlerepo.py", line 204, in <module>:
Overriding method signature mismatch [signature-mismatch]
Base signature: 'def mercurial.manifest.ManifestRevlog.clearcaches(self, clear_persisted_data: Any = ...) -> None'.
Subclass signature: 'def mercurial.revlog.revlog.clearcaches(self) -> None'.
Not enough positional parameters in overriding method.
Maybe the multiple inheritance in `bundlerepo.bundlemanifest` is bad, but it
seems like a `ManifestRevlog` is-a `revlog`, even though the class hierarchy
isn't coded that way. Additionally, it looks like `revlog.clearcaches()` is
dealing with some persistent data, so maybe this is useful to have there anyway.
Also sprinkle some trivial type hints on the method, because there are other
`clearcaches()` definitions in the codebase with these hints, and I don't feel
like waiting for another pytype run to see if it cares that specifically about
the signature matching.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 18 Sep 2024 17:46:46 -0400 |
parents | 7b6d3a9bd7be |
children |
line wrap: on
line source
/assign_reviewer @mercurial.review <!-- Welcome to the Mercurial Merge Request creation process: * Set a simple title for your MR, * All important information should be contained in your changesets' content or description, * You can add some workflow-relevant information here (eg: when this depends on another MR), * If your changes are not ready for review yet, click `Start the title with Draft:` under the title. More details here: * https://www.mercurial-scm.org/wiki/ContributingChanges * https://www.mercurial-scm.org/wiki/Heptapod -->