##// END OF EJS Templates
verify: introduce a notion of "level"...
marmoute -
r42331:57539e5e default
parent child Browse files
Show More
@@ -1092,9 +1092,9 b' def outgoing(ui, repo, dest, opts):'
1092 recurse()
1092 recurse()
1093 return 0 # exit code is zero since we found outgoing changes
1093 return 0 # exit code is zero since we found outgoing changes
1094
1094
1095 def verify(repo):
1095 def verify(repo, level=None):
1096 """verify the consistency of a repository"""
1096 """verify the consistency of a repository"""
1097 ret = verifymod.verify(repo)
1097 ret = verifymod.verify(repo, level=level)
1098
1098
1099 # Broken subrepo references in hidden csets don't seem worth worrying about,
1099 # Broken subrepo references in hidden csets don't seem worth worrying about,
1100 # since they can't be pushed/pulled, and --hidden can be used if they are a
1100 # since they can't be pushed/pulled, and --hidden can be used if they are a
@@ -22,9 +22,12 b' from . import ('
22 util,
22 util,
23 )
23 )
24
24
25 def verify(repo):
25 VERIFY_DEFAULT = 0
26
27 def verify(repo, level=None):
26 with repo.lock():
28 with repo.lock():
27 return verifier(repo).verify()
29 v = verifier(repo, level)
30 return v.verify()
28
31
29 def _normpath(f):
32 def _normpath(f):
30 # under hg < 2.4, convert didn't sanitize paths properly, so a
33 # under hg < 2.4, convert didn't sanitize paths properly, so a
@@ -34,10 +37,13 b' def _normpath(f):'
34 return f
37 return f
35
38
36 class verifier(object):
39 class verifier(object):
37 def __init__(self, repo):
40 def __init__(self, repo, level=None):
38 self.repo = repo.unfiltered()
41 self.repo = repo.unfiltered()
39 self.ui = repo.ui
42 self.ui = repo.ui
40 self.match = repo.narrowmatch()
43 self.match = repo.narrowmatch()
44 if level is None:
45 level = VERIFY_DEFAULT
46 self._level = level
41 self.badrevs = set()
47 self.badrevs = set()
42 self.errors = 0
48 self.errors = 0
43 self.warnings = 0
49 self.warnings = 0
General Comments 0
You need to be logged in to leave comments. Login now