# HG changeset patch # User Matt Harbison # Date 2024-08-20 02:46:09 # Node ID bcaa5d408657e4a528ff224bc1815ffcf489623a # Parent 5eb98ea78fd7b93f28b6d5c946581a0b7e0b64e1 typing: make the revlog classes known to pytype These are the same changes as c1d7ac70980b and 45270e286bdc made to dirstate, for the same reasons. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -186,9 +186,8 @@ HAS_FAST_PERSISTENT_NODEMAP = rustrevlog ) -@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 @@ class revlogrevisiondelta: 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)