Mercurial > hg
diff mercurial/revlog.py @ 52064:61557734c0ae
revlog: drop the CamelCase name for `revlog.revlogrevisiondelta`
These CamelCase names popped up this cycle because pytype was getting confused
by the zope decorator, and so the decoration was decoupled from the class
declaration. We're in the process of switching all of the zope interfaces to
`typing.Protocol` classes, but we're up against the code freeze. It would be
nice to use CamelCase for protocol classes (or classes in general), but let's
reset to a consistent state and buy some more time to think about this.
Since we're moving to Protocol classes and I disabled the interface tests back
in ef7d85089952, I'm not bothering to re-add the decorator, and re-confuse
pytype. But do place the interface next to the class, so that these places can
be found with the `grep` when the time comes to subclass.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 23 Oct 2024 16:19:24 -0400 |
parents | 609700e5d8df |
children | 9e94f9dbbbe8 |
line wrap: on
line diff
--- a/mercurial/revlog.py Wed Oct 23 16:14:13 2024 +0200 +++ b/mercurial/revlog.py Wed Oct 23 16:19:24 2024 -0400 @@ -190,7 +190,7 @@ @attr.s(slots=True) -class RevLogRevisionDelta: +class revlogrevisiondelta: # (repository.irevisiondelta) node = attr.ib() p1node = attr.ib() p2node = attr.ib() @@ -204,14 +204,6 @@ linknode = attr.ib(default=None) -revlogrevisiondelta = interfaceutil.implementer(repository.irevisiondelta)( - RevLogRevisionDelta -) - -if typing.TYPE_CHECKING: - revlogrevisiondelta = RevLogRevisionDelta - - @attr.s(frozen=True) class RevLogProblem: warning = attr.ib(default=None, type=Optional[bytes])