comparison mercurial/repository.py @ 39872:733db72f0f54

revlog: move revision verification out of verify File revision verification is performing low-level checks of file storage, namely that flags are appropriate and revision data can be resolved. Since these checks are somewhat revlog-specific and may not be appropriate for alternate storage backends, this commit moves those checks from verify.py to revlog.py. Because we're now emitting warnings/errors that apply to specific revisions, we taught the iverifyproblem interface to expose the problematic node and to report this node in verify output. This was necessary to prevent unwanted test changes. After this change, revlog.verifyintegrity() and file verify code in verify.py both iterate over revisions and resolve their fulltext. But they do so in separate loops. (verify.py needs to resolve fulltexts as part of calling renamed() - at least when using revlogs.) This should add overhead. But on the mozilla-unified repo: $ hg verify before: time: real 700.640 secs (user 585.520+0.000 sys 23.480+0.000) after: time: real 682.380 secs (user 570.370+0.000 sys 22.240+0.000) I'm not sure what's going on. Maybe avoiding the filelog attribute proxies shaved off enough time to offset the losses? Maybe fulltext resolution has less overhead than I thought? I've left a comment indicating the potential for optimization. But because it doesn't produce a performance regression on a large repository, I'm not going to worry about it. Differential Revision: https://phab.mercurial-scm.org/D4745
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 24 Sep 2018 11:27:47 -0700
parents 14e500b58263
children 2ac4f3e97813
comparison
equal deleted inserted replaced
39871:01c0f01b562b 39872:733db72f0f54
338 warning = interfaceutil.Attribute( 338 warning = interfaceutil.Attribute(
339 """Message indicating a non-fatal problem.""") 339 """Message indicating a non-fatal problem.""")
340 340
341 error = interfaceutil.Attribute( 341 error = interfaceutil.Attribute(
342 """Message indicating a fatal problem.""") 342 """Message indicating a fatal problem.""")
343
344 node = interfaceutil.Attribute(
345 """Revision encountering the problem.
346
347 ``None`` means the problem doesn't apply to a single revision.
348 """)
343 349
344 class irevisiondelta(interfaceutil.Interface): 350 class irevisiondelta(interfaceutil.Interface):
345 """Represents a delta between one revision and another. 351 """Represents a delta between one revision and another.
346 352
347 Instances convey enough information to allow a revision to be exchanged 353 Instances convey enough information to allow a revision to be exchanged
788 794
789 ``state`` is a dict holding state of the verifier process. It can be 795 ``state`` is a dict holding state of the verifier process. It can be
790 used to communicate data between invocations of multiple storage 796 used to communicate data between invocations of multiple storage
791 primitives. 797 primitives.
792 798
799 If individual revisions cannot have their revision content resolved,
800 the method is expected to set the ``skipread`` key to a set of nodes
801 that encountered problems.
802
793 The method yields objects conforming to the ``iverifyproblem`` 803 The method yields objects conforming to the ``iverifyproblem``
794 interface. 804 interface.
795 """ 805 """
796 806
797 class idirs(interfaceutil.Interface): 807 class idirs(interfaceutil.Interface):