##// END OF EJS Templates
verify: use set instead of dict
Benoit Boissinot -
r8466:afb3e504 default
parent child Browse files
Show More
@@ -21,7 +21,7 b' def _verify(repo):'
21 filelinkrevs = {}
21 filelinkrevs = {}
22 filenodes = {}
22 filenodes = {}
23 revisions = 0
23 revisions = 0
24 badrevs = {}
24 badrevs = set()
25 errors = [0]
25 errors = [0]
26 warnings = [0]
26 warnings = [0]
27 ui = repo.ui
27 ui = repo.ui
@@ -33,7 +33,7 b' def _verify(repo):'
33
33
34 def err(linkrev, msg, filename=None):
34 def err(linkrev, msg, filename=None):
35 if linkrev != None:
35 if linkrev != None:
36 badrevs[linkrev] = True
36 badrevs.add(linkrev)
37 else:
37 else:
38 linkrev = '?'
38 linkrev = '?'
39 msg = "%s: %s" % (linkrev, msg)
39 msg = "%s: %s" % (linkrev, msg)
@@ -166,12 +166,12 b' def _verify(repo):'
166
166
167 ui.status(_("checking files\n"))
167 ui.status(_("checking files\n"))
168
168
169 storefiles = {}
169 storefiles = set()
170 for f, f2, size in repo.store.datafiles():
170 for f, f2, size in repo.store.datafiles():
171 if not f:
171 if not f:
172 err(None, _("cannot decode filename '%s'") % f2)
172 err(None, _("cannot decode filename '%s'") % f2)
173 elif size > 0:
173 elif size > 0:
174 storefiles[f] = True
174 storefiles.add(f)
175
175
176 files = sorted(set(filenodes) | set(filelinkrevs))
176 files = sorted(set(filenodes) | set(filelinkrevs))
177 for f in files:
177 for f in files:
@@ -194,7 +194,7 b' def _verify(repo):'
194
194
195 for ff in fl.files():
195 for ff in fl.files():
196 try:
196 try:
197 del storefiles[ff]
197 storefiles.remove(ff)
198 except KeyError:
198 except KeyError:
199 err(lr, _("missing revlog!"), ff)
199 err(lr, _("missing revlog!"), ff)
200
200
General Comments 0
You need to be logged in to leave comments. Login now