diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -154,9 +154,6 @@ class verifier(object): ui.status(_("repository uses revlog format %d\n") % (revlogv1 and 1 or 0)) - havecl = self.havecl - havemf = self.havemf - ui.status(_("checking changesets\n")) seen = {} self.checklog(cl, "changelog", 0) @@ -208,11 +205,33 @@ class verifier(object): self.exc(lr, _("reading manifest delta %s") % short(n), inst) ui.progress(_('checking'), None) + self._crosscheckfiles(mflinkrevs, filelinkrevs, filenodes) + + totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs) + revisions += filerevisions + + ui.status(_("%d files, %d changesets, %d total revisions\n") % + (totalfiles, len(cl), revisions)) + if self.warnings: + ui.warn(_("%d warnings encountered!\n") % self.warnings) + if self.fncachewarned: + ui.warn(_('hint: run "hg debugrebuildfncache" to recover from ' + 'corrupt fncache\n')) + if self.errors: + ui.warn(_("%d integrity errors encountered!\n") % self.errors) + if badrevs: + ui.warn(_("(first damaged changeset appears to be %d)\n") + % min(badrevs)) + return 1 + + def _crosscheckfiles(self, mflinkrevs, filelinkrevs, filenodes): + repo = self.repo + ui = self.ui ui.status(_("crosschecking files in changesets and manifests\n")) total = len(mflinkrevs) + len(filelinkrevs) + len(filenodes) count = 0 - if havemf: + if self.havemf: for c, m in sorted([(c, m) for m in mflinkrevs for c in mflinkrevs[m]]): count += 1 @@ -230,7 +249,7 @@ class verifier(object): lr = filelinkrevs[f][0] self.err(lr, _("in changeset but not in manifest"), f) - if havecl: + if self.havecl: for f in sorted(filenodes): count += 1 ui.progress(_('crosschecking'), count, total=total) @@ -244,23 +263,6 @@ class verifier(object): ui.progress(_('crosschecking'), None) - totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs) - revisions += filerevisions - - ui.status(_("%d files, %d changesets, %d total revisions\n") % - (totalfiles, len(cl), revisions)) - if self.warnings: - ui.warn(_("%d warnings encountered!\n") % self.warnings) - if self.fncachewarned: - ui.warn(_('hint: run "hg debugrebuildfncache" to recover from ' - 'corrupt fncache\n')) - if self.errors: - ui.warn(_("%d integrity errors encountered!\n") % self.errors) - if badrevs: - ui.warn(_("(first damaged changeset appears to be %d)\n") - % min(badrevs)) - return 1 - def _verifyfiles(self, filenodes, filelinkrevs): repo = self.repo ui = self.ui