##// END OF EJS Templates
typing: make the manifest classes known to pytype...
Matt Harbison -
r52716:5eb98ea7 default
parent child Browse files
Show More
@@ -9,6 +9,7
9 import heapq
9 import heapq
10 import itertools
10 import itertools
11 import struct
11 import struct
12 import typing
12 import weakref
13 import weakref
13
14
14 from typing import (
15 from typing import (
@@ -753,6 +754,9 class ManifestDict:
753
754
754 manifestdict = interfaceutil.implementer(repository.imanifestdict)(ManifestDict)
755 manifestdict = interfaceutil.implementer(repository.imanifestdict)(ManifestDict)
755
756
757 if typing.TYPE_CHECKING:
758 manifestdict = ManifestDict
759
756
760
757 def _msearch(
761 def _msearch(
758 m: ByteString, s: bytes, lo: int = 0, hi: Optional[int] = None
762 m: ByteString, s: bytes, lo: int = 0, hi: Optional[int] = None
@@ -1535,6 +1539,9 class TreeManifest:
1535
1539
1536 treemanifest = interfaceutil.implementer(repository.imanifestdict)(TreeManifest)
1540 treemanifest = interfaceutil.implementer(repository.imanifestdict)(TreeManifest)
1537
1541
1542 if typing.TYPE_CHECKING:
1543 treemanifest = TreeManifest
1544
1538
1545
1539 class manifestfulltextcache(util.lrucachedict):
1546 class manifestfulltextcache(util.lrucachedict):
1540 """File-backed LRU cache for the manifest cache
1547 """File-backed LRU cache for the manifest cache
@@ -2047,13 +2054,14 manifestrevlog = interfaceutil.implement
2047 ManifestRevlog
2054 ManifestRevlog
2048 )
2055 )
2049
2056
2057 if typing.TYPE_CHECKING:
2058 manifestrevlog = ManifestRevlog
2050
2059
2051 AnyManifestCtx = Union['ManifestCtx', 'TreeManifestCtx']
2060 AnyManifestCtx = Union['ManifestCtx', 'TreeManifestCtx']
2052 AnyManifestDict = Union[ManifestDict, TreeManifest]
2061 AnyManifestDict = Union[ManifestDict, TreeManifest]
2053
2062
2054
2063
2055 @interfaceutil.implementer(repository.imanifestlog)
2064 class ManifestLog:
2056 class manifestlog:
2057 """A collection class representing the collection of manifest snapshots
2065 """A collection class representing the collection of manifest snapshots
2058 referenced by commits in the repository.
2066 referenced by commits in the repository.
2059
2067
@@ -2157,6 +2165,12 class manifestlog:
2157 return self._rootstore._revlog.update_caches(transaction=transaction)
2165 return self._rootstore._revlog.update_caches(transaction=transaction)
2158
2166
2159
2167
2168 manifestlog = interfaceutil.implementer(repository.imanifestlog)(ManifestLog)
2169
2170 if typing.TYPE_CHECKING:
2171 manifestlog = ManifestLog
2172
2173
2160 class MemManifestCtx:
2174 class MemManifestCtx:
2161 def __init__(self, manifestlog):
2175 def __init__(self, manifestlog):
2162 self._manifestlog = manifestlog
2176 self._manifestlog = manifestlog
@@ -2190,6 +2204,9 memmanifestctx = interfaceutil.implement
2190 repository.imanifestrevisionwritable
2204 repository.imanifestrevisionwritable
2191 )(MemManifestCtx)
2205 )(MemManifestCtx)
2192
2206
2207 if typing.TYPE_CHECKING:
2208 memmanifestctx = MemManifestCtx
2209
2193
2210
2194 class ManifestCtx:
2211 class ManifestCtx:
2195 """A class representing a single revision of a manifest, including its
2212 """A class representing a single revision of a manifest, including its
@@ -2353,6 +2370,9 manifestctx = interfaceutil.implementer(
2353 ManifestCtx
2370 ManifestCtx
2354 )
2371 )
2355
2372
2373 if typing.TYPE_CHECKING:
2374 manifestctx = ManifestCtx
2375
2356
2376
2357 class MemTreeManifestCtx:
2377 class MemTreeManifestCtx:
2358 def __init__(self, manifestlog, dir=b''):
2378 def __init__(self, manifestlog, dir=b''):
@@ -2392,6 +2412,9 memtreemanifestctx = interfaceutil.imple
2392 repository.imanifestrevisionwritable
2412 repository.imanifestrevisionwritable
2393 )(MemTreeManifestCtx)
2413 )(MemTreeManifestCtx)
2394
2414
2415 if typing.TYPE_CHECKING:
2416 memtreemanifestctx = MemTreeManifestCtx
2417
2395
2418
2396 class TreeManifestCtx:
2419 class TreeManifestCtx:
2397 def __init__(self, manifestlog, dir, node):
2420 def __init__(self, manifestlog, dir, node):
@@ -2660,6 +2683,9 treemanifestctx = interfaceutil.implemen
2660 TreeManifestCtx
2683 TreeManifestCtx
2661 )
2684 )
2662
2685
2686 if typing.TYPE_CHECKING:
2687 treemanifestctx = TreeManifestCtx
2688
2663
2689
2664 class excludeddir(treemanifest):
2690 class excludeddir(treemanifest):
2665 """Stand-in for a directory that is excluded from the repository.
2691 """Stand-in for a directory that is excluded from the repository.
General Comments 0
You need to be logged in to leave comments. Login now