Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 52060: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 |
comparison
equal
deleted
inserted
replaced
52059:43602c675b4f | 52060:61557734c0ae |
---|---|
188 parsers, 'BaseIndexObject' | 188 parsers, 'BaseIndexObject' |
189 ) | 189 ) |
190 | 190 |
191 | 191 |
192 @attr.s(slots=True) | 192 @attr.s(slots=True) |
193 class RevLogRevisionDelta: | 193 class revlogrevisiondelta: # (repository.irevisiondelta) |
194 node = attr.ib() | 194 node = attr.ib() |
195 p1node = attr.ib() | 195 p1node = attr.ib() |
196 p2node = attr.ib() | 196 p2node = attr.ib() |
197 basenode = attr.ib() | 197 basenode = attr.ib() |
198 flags = attr.ib() | 198 flags = attr.ib() |
200 revision = attr.ib() | 200 revision = attr.ib() |
201 delta = attr.ib() | 201 delta = attr.ib() |
202 sidedata = attr.ib() | 202 sidedata = attr.ib() |
203 protocol_flags = attr.ib() | 203 protocol_flags = attr.ib() |
204 linknode = attr.ib(default=None) | 204 linknode = attr.ib(default=None) |
205 | |
206 | |
207 revlogrevisiondelta = interfaceutil.implementer(repository.irevisiondelta)( | |
208 RevLogRevisionDelta | |
209 ) | |
210 | |
211 if typing.TYPE_CHECKING: | |
212 revlogrevisiondelta = RevLogRevisionDelta | |
213 | 205 |
214 | 206 |
215 @attr.s(frozen=True) | 207 @attr.s(frozen=True) |
216 class RevLogProblem: | 208 class RevLogProblem: |
217 warning = attr.ib(default=None, type=Optional[bytes]) | 209 warning = attr.ib(default=None, type=Optional[bytes]) |