diff -r e78b75f3cea9 -r 5eb98ea78fd7 mercurial/manifest.py --- a/mercurial/manifest.py Mon Aug 19 22:21:16 2024 -0400 +++ b/mercurial/manifest.py Mon Aug 19 22:27:43 2024 -0400 @@ -9,6 +9,7 @@ import heapq import itertools import struct +import typing import weakref from typing import ( @@ -753,6 +754,9 @@ manifestdict = interfaceutil.implementer(repository.imanifestdict)(ManifestDict) +if typing.TYPE_CHECKING: + manifestdict = ManifestDict + def _msearch( m: ByteString, s: bytes, lo: int = 0, hi: Optional[int] = None @@ -1535,6 +1539,9 @@ treemanifest = interfaceutil.implementer(repository.imanifestdict)(TreeManifest) +if typing.TYPE_CHECKING: + treemanifest = TreeManifest + class manifestfulltextcache(util.lrucachedict): """File-backed LRU cache for the manifest cache @@ -2047,13 +2054,14 @@ ManifestRevlog ) +if typing.TYPE_CHECKING: + manifestrevlog = ManifestRevlog AnyManifestCtx = Union['ManifestCtx', 'TreeManifestCtx'] AnyManifestDict = Union[ManifestDict, TreeManifest] -@interfaceutil.implementer(repository.imanifestlog) -class manifestlog: +class ManifestLog: """A collection class representing the collection of manifest snapshots referenced by commits in the repository. @@ -2157,6 +2165,12 @@ return self._rootstore._revlog.update_caches(transaction=transaction) +manifestlog = interfaceutil.implementer(repository.imanifestlog)(ManifestLog) + +if typing.TYPE_CHECKING: + manifestlog = ManifestLog + + class MemManifestCtx: def __init__(self, manifestlog): self._manifestlog = manifestlog @@ -2190,6 +2204,9 @@ repository.imanifestrevisionwritable )(MemManifestCtx) +if typing.TYPE_CHECKING: + memmanifestctx = MemManifestCtx + class ManifestCtx: """A class representing a single revision of a manifest, including its @@ -2353,6 +2370,9 @@ ManifestCtx ) +if typing.TYPE_CHECKING: + manifestctx = ManifestCtx + class MemTreeManifestCtx: def __init__(self, manifestlog, dir=b''): @@ -2392,6 +2412,9 @@ repository.imanifestrevisionwritable )(MemTreeManifestCtx) +if typing.TYPE_CHECKING: + memtreemanifestctx = MemTreeManifestCtx + class TreeManifestCtx: def __init__(self, manifestlog, dir, node): @@ -2660,6 +2683,9 @@ TreeManifestCtx ) +if typing.TYPE_CHECKING: + treemanifestctx = TreeManifestCtx + class excludeddir(treemanifest): """Stand-in for a directory that is excluded from the repository.