comparison mercurial/manifest.py @ 52070:33f255bf19d9

manifest: drop the CamelCase name for `manifest.treemanifestctx` See 61557734c0ae for the reasoning.
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 23 Oct 2024 16:48:46 -0400
parents 569e074894fa
children 0851d94bfdaa
comparison
equal deleted inserted replaced
52069:569e074894fa 52070:33f255bf19d9
8 from __future__ import annotations 8 from __future__ import annotations
9 9
10 import heapq 10 import heapq
11 import itertools 11 import itertools
12 import struct 12 import struct
13 import typing
14 import weakref 13 import weakref
15 14
16 from typing import ( 15 from typing import (
17 ByteString, 16 ByteString,
18 Callable, 17 Callable,
45 revlog, 44 revlog,
46 util, 45 util,
47 ) 46 )
48 from .interfaces import ( 47 from .interfaces import (
49 repository, 48 repository,
50 util as interfaceutil,
51 ) 49 )
52 from .revlogutils import ( 50 from .revlogutils import (
53 constants as revlog_constants, 51 constants as revlog_constants,
54 ) 52 )
55 53
2043 @opener.setter 2041 @opener.setter
2044 def opener(self, value): 2042 def opener(self, value):
2045 self._revlog.opener = value 2043 self._revlog.opener = value
2046 2044
2047 2045
2048 AnyManifestCtx = Union['manifestctx', 'TreeManifestCtx'] 2046 # TODO: drop this in favor of repository.imanifestrevisionstored?
2047 AnyManifestCtx = Union['manifestctx', 'treemanifestctx']
2049 # TODO: drop this in favor of repository.imanifestdict 2048 # TODO: drop this in favor of repository.imanifestdict
2050 AnyManifestDict = Union[manifestdict, treemanifest] 2049 AnyManifestDict = Union[manifestdict, treemanifest]
2051 2050
2052 2051
2053 class manifestlog: # (repository.imanifestlog) 2052 class manifestlog: # (repository.imanifestlog)
2379 readtree=readtree, 2378 readtree=readtree,
2380 match=match, 2379 match=match,
2381 ) 2380 )
2382 2381
2383 2382
2384 class TreeManifestCtx: 2383 class treemanifestctx: # (repository.imanifestrevisionstored)
2385 _data: Optional[treemanifest] 2384 _data: Optional[treemanifest]
2386 2385
2387 def __init__(self, manifestlog, dir, node): 2386 def __init__(self, manifestlog, dir, node):
2388 self._manifestlog = manifestlog 2387 self._manifestlog = manifestlog
2389 self._dir = dir 2388 self._dir = dir
2644 2643
2645 def find(self, key: bytes) -> Tuple[bytes, bytes]: 2644 def find(self, key: bytes) -> Tuple[bytes, bytes]:
2646 return self.read().find(key) 2645 return self.read().find(key)
2647 2646
2648 2647
2649 treemanifestctx = interfaceutil.implementer(repository.imanifestrevisionstored)(
2650 TreeManifestCtx
2651 )
2652
2653 if typing.TYPE_CHECKING:
2654 treemanifestctx = TreeManifestCtx
2655
2656
2657 class excludeddir(treemanifest): 2648 class excludeddir(treemanifest):
2658 """Stand-in for a directory that is excluded from the repository. 2649 """Stand-in for a directory that is excluded from the repository.
2659 2650
2660 With narrowing active on a repository that uses treemanifests, 2651 With narrowing active on a repository that uses treemanifests,
2661 some of the directory revlogs will be excluded from the resulting 2652 some of the directory revlogs will be excluded from the resulting