revlog: drop the CamelCase name for `revlog.revlogrevisiondelta`
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 23 Oct 2024 16:19:24 -0400
changeset 52064 61557734c0ae
parent 52063 43602c675b4f
child 52065 9e94f9dbbbe8
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.
hgext/remotefilelog/remotefilelog.py
mercurial/revlog.py
--- a/hgext/remotefilelog/remotefilelog.py	Wed Oct 23 16:14:13 2024 +0200
+++ b/hgext/remotefilelog/remotefilelog.py	Wed Oct 23 16:19:24 2024 -0400
@@ -302,7 +302,7 @@
         deltamode=None,
         sidedata_helpers=None,
         debug_info=None,
-    ) -> Iterator[revlog.RevLogRevisionDelta]:
+    ) -> Iterator[revlog.revlogrevisiondelta]:
         # we don't use any of these parameters here
         del nodesorder, revisiondata, assumehaveparentrevisions, deltaprevious
         del deltamode
--- 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])