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