typing: make the revlog classes known to pytype
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 19 Aug 2024 22:46:09 -0400
changeset 51824 bcaa5d408657
parent 51823 5eb98ea78fd7
child 51825 766c55492258
typing: make the revlog classes known to pytype These are the same changes as c1d7ac70980b and 45270e286bdc made to dirstate, for the same reasons.
mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Aug 19 22:27:43 2024 -0400
+++ b/mercurial/revlog.py	Mon Aug 19 22:46:09 2024 -0400
@@ -186,9 +186,8 @@
 )
 
 
-@interfaceutil.implementer(repository.irevisiondelta)
 @attr.s(slots=True)
-class revlogrevisiondelta:
+class RevLogRevisionDelta:
     node = attr.ib()
     p1node = attr.ib()
     p2node = attr.ib()
@@ -202,14 +201,29 @@
     linknode = attr.ib(default=None)
 
 
-@interfaceutil.implementer(repository.iverifyproblem)
+revlogrevisiondelta = interfaceutil.implementer(repository.irevisiondelta)(
+    RevLogRevisionDelta
+)
+
+if typing.TYPE_CHECKING:
+    revlogrevisiondelta = RevLogRevisionDelta
+
+
 @attr.s(frozen=True)
-class revlogproblem:
+class RevLogProblem:
     warning = attr.ib(default=None)
     error = attr.ib(default=None)
     node = attr.ib(default=None)
 
 
+revlogproblem = interfaceutil.implementer(repository.iverifyproblem)(
+    RevLogProblem
+)
+
+if typing.TYPE_CHECKING:
+    revlogproblem = RevLogProblem
+
+
 def parse_index_v1(data, inline):
     # call the C implementation to parse the index data
     index, cache = parsers.parse_index2(data, inline)