##// END OF EJS Templates
verify: use progress helper...
Martin von Zweigbergk -
r38416:1249475f default
parent child Browse files
Show More
@@ -178,9 +178,10 b' class verifier(object):'
178 filelinkrevs = {}
178 filelinkrevs = {}
179 seen = {}
179 seen = {}
180 self.checklog(cl, "changelog", 0)
180 self.checklog(cl, "changelog", 0)
181 total = len(repo)
181 progress = ui.makeprogress(_('checking'), unit=_('changesets'),
182 total=len(repo))
182 for i in repo:
183 for i in repo:
183 ui.progress(_('checking'), i, total=total, unit=_('changesets'))
184 progress.update(i)
184 n = cl.node(i)
185 n = cl.node(i)
185 self.checkentry(cl, i, n, seen, [i], "changelog")
186 self.checkentry(cl, i, n, seen, [i], "changelog")
186
187
@@ -195,7 +196,7 b' class verifier(object):'
195 except Exception as inst:
196 except Exception as inst:
196 self.refersmf = True
197 self.refersmf = True
197 self.exc(i, _("unpacking changeset %s") % short(n), inst)
198 self.exc(i, _("unpacking changeset %s") % short(n), inst)
198 ui.progress(_('checking'), None)
199 progress.complete()
199 return mflinkrevs, filelinkrevs
200 return mflinkrevs, filelinkrevs
200
201
201 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None,
202 def _verifymanifest(self, mflinkrevs, dir="", storefiles=None,
@@ -223,10 +224,11 b' class verifier(object):'
223 # Do not check manifest if there are only changelog entries with
224 # Do not check manifest if there are only changelog entries with
224 # null manifests.
225 # null manifests.
225 self.checklog(mf, label, 0)
226 self.checklog(mf, label, 0)
226 total = len(mf)
227 progress = ui.makeprogress(_('checking'), unit=_('manifests'),
228 total=len(mf))
227 for i in mf:
229 for i in mf:
228 if not dir:
230 if not dir:
229 ui.progress(_('checking'), i, total=total, unit=_('manifests'))
231 progress.update(i)
230 n = mf.node(i)
232 n = mf.node(i)
231 lr = self.checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label)
233 lr = self.checkentry(mf, i, n, seen, mflinkrevs.get(n, []), label)
232 if n in mflinkrevs:
234 if n in mflinkrevs:
@@ -257,7 +259,7 b' class verifier(object):'
257 except Exception as inst:
259 except Exception as inst:
258 self.exc(lr, _("reading delta %s") % short(n), inst, label)
260 self.exc(lr, _("reading delta %s") % short(n), inst, label)
259 if not dir:
261 if not dir:
260 ui.progress(_('checking'), None)
262 progress.complete()
261
263
262 if self.havemf:
264 if self.havemf:
263 for c, m in sorted([(c, m) for m in mflinkrevs
265 for c, m in sorted([(c, m) for m in mflinkrevs
@@ -303,19 +305,17 b' class verifier(object):'
303 ui.status(_("crosschecking files in changesets and manifests\n"))
305 ui.status(_("crosschecking files in changesets and manifests\n"))
304
306
305 total = len(filelinkrevs) + len(filenodes)
307 total = len(filelinkrevs) + len(filenodes)
306 count = 0
308 progress = ui.makeprogress(_('crosschecking'), total=total)
307 if self.havemf:
309 if self.havemf:
308 for f in sorted(filelinkrevs):
310 for f in sorted(filelinkrevs):
309 count += 1
311 progress.increment()
310 ui.progress(_('crosschecking'), count, total=total)
311 if f not in filenodes:
312 if f not in filenodes:
312 lr = filelinkrevs[f][0]
313 lr = filelinkrevs[f][0]
313 self.err(lr, _("in changeset but not in manifest"), f)
314 self.err(lr, _("in changeset but not in manifest"), f)
314
315
315 if self.havecl:
316 if self.havecl:
316 for f in sorted(filenodes):
317 for f in sorted(filenodes):
317 count += 1
318 progress.increment()
318 ui.progress(_('crosschecking'), count, total=total)
319 if f not in filelinkrevs:
319 if f not in filelinkrevs:
320 try:
320 try:
321 fl = repo.file(f)
321 fl = repo.file(f)
@@ -324,7 +324,7 b' class verifier(object):'
324 lr = None
324 lr = None
325 self.err(lr, _("in manifest but not in changeset"), f)
325 self.err(lr, _("in manifest but not in changeset"), f)
326
326
327 ui.progress(_('crosschecking'), None)
327 progress.complete()
328
328
329 def _verifyfiles(self, filenodes, filelinkrevs):
329 def _verifyfiles(self, filenodes, filelinkrevs):
330 repo = self.repo
330 repo = self.repo
@@ -342,10 +342,11 b' class verifier(object):'
342 storefiles.add(_normpath(f))
342 storefiles.add(_normpath(f))
343
343
344 files = sorted(set(filenodes) | set(filelinkrevs))
344 files = sorted(set(filenodes) | set(filelinkrevs))
345 total = len(files)
346 revisions = 0
345 revisions = 0
346 progress = ui.makeprogress(_('checking'), unit=_('files'),
347 total=len(files))
347 for i, f in enumerate(files):
348 for i, f in enumerate(files):
348 ui.progress(_('checking'), i, item=f, total=total, unit=_('files'))
349 progress.update(i, item=f)
349 try:
350 try:
350 linkrevs = filelinkrevs[f]
351 linkrevs = filelinkrevs[f]
351 except KeyError:
352 except KeyError:
@@ -479,7 +480,7 b' class verifier(object):'
479 for lr, node in sorted(fns):
480 for lr, node in sorted(fns):
480 self.err(lr, _("manifest refers to unknown revision %s") %
481 self.err(lr, _("manifest refers to unknown revision %s") %
481 short(node), f)
482 short(node), f)
482 ui.progress(_('checking'), None)
483 progress.complete()
483
484
484 if self.warnorphanstorefiles:
485 if self.warnorphanstorefiles:
485 for f in sorted(storefiles):
486 for f in sorted(storefiles):
General Comments 0
You need to be logged in to leave comments. Login now