##// END OF EJS Templates
revlog: subclass the new `repository.iverifyproblem` Protocol class...
Matt Harbison -
r53365:4ef6dbc2 default
parent child Browse files
Show More
@@ -51,6 +51,10 import threading
51 51 import typing
52 52 import zlib
53 53
54 from typing import (
55 Optional,
56 )
57
54 58 from mercurial.i18n import _
55 59 from mercurial.node import (
56 60 nullrev,
@@ -300,12 +304,11 class sqliterevisiondelta:
300 304 linknode = attr.ib(default=None)
301 305
302 306
303 @interfaceutil.implementer(repository.iverifyproblem)
304 307 @attr.s(frozen=True)
305 class sqliteproblem:
306 warning = attr.ib(default=None)
307 error = attr.ib(default=None)
308 node = attr.ib(default=None)
308 class sqliteproblem(repository.iverifyproblem):
309 warning = attr.ib(default=None, type=Optional[bytes])
310 error = attr.ib(default=None, type=Optional[bytes])
311 node = attr.ib(default=None, type=Optional[bytes])
309 312
310 313
311 314 @interfaceutil.implementer(repository.ifilestorage)
@@ -241,7 +241,7 class filelog: # (repository.ifilestora
241 241 """
242 242 return not storageutil.filedataequivalent(self, node, text)
243 243
244 def verifyintegrity(self, state) -> Iterable[revlog.revlogproblem]:
244 def verifyintegrity(self, state) -> Iterable[repository.iverifyproblem]:
245 245 return self._revlog.verifyintegrity(state)
246 246
247 247 def storageinfo(
@@ -204,7 +204,7 class revlogrevisiondelta: # (repositor
204 204
205 205
206 206 @attr.s(frozen=True)
207 class revlogproblem: # (repository.iverifyproblem)
207 class revlogproblem(repository.iverifyproblem):
208 208 warning = attr.ib(default=None, type=Optional[bytes])
209 209 error = attr.ib(default=None, type=Optional[bytes])
210 210 node = attr.ib(default=None, type=Optional[bytes])
@@ -4021,7 +4021,7 class revlog:
4021 4021 else:
4022 4022 rewrite.v2_censor(self, tr, censor_nodes, tombstone)
4023 4023
4024 def verifyintegrity(self, state) -> Iterable[revlogproblem]:
4024 def verifyintegrity(self, state) -> Iterable[repository.iverifyproblem]:
4025 4025 """Verifies the integrity of the revlog.
4026 4026
4027 4027 Yields ``revlogproblem`` instances describing problems that are
@@ -13,6 +13,10
13 13
14 14 import stat
15 15
16 from typing import (
17 Optional,
18 )
19
16 20 from mercurial.i18n import _
17 21 from mercurial.node import (
18 22 bin,
@@ -82,12 +86,11 class simplestorerevisiondelta:
82 86 linknode = attr.ib(default=None)
83 87
84 88
85 @interfaceutil.implementer(repository.iverifyproblem)
86 89 @attr.s(frozen=True)
87 class simplefilestoreproblem:
88 warning = attr.ib(default=None)
89 error = attr.ib(default=None)
90 node = attr.ib(default=None)
90 class simplefilestoreproblem(repository.iverifyproblem):
91 warning = attr.ib(default=None, type=Optional[bytes])
92 error = attr.ib(default=None, type=Optional[bytes])
93 node = attr.ib(default=None, type=Optional[bytes])
91 94
92 95
93 96 @interfaceutil.implementer(repository.ifilestorage)
General Comments 0
You need to be logged in to leave comments. Login now