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