diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -270,22 +270,23 @@ class verifier: progress = ui.makeprogress( _(b'checking'), unit=_(b'changesets'), total=len(repo) ) - for i in repo: - progress.update(i) - n = cl.node(i) - self._checkentry(cl, i, n, seen, [i], b"changelog") + with cl.reading(): + for i in repo: + progress.update(i) + n = cl.node(i) + self._checkentry(cl, i, n, seen, [i], b"changelog") - try: - changes = cl.read(n) - if changes[0] != self.repo.nullid: - mflinkrevs.setdefault(changes[0], []).append(i) + try: + changes = cl.read(n) + if changes[0] != self.repo.nullid: + mflinkrevs.setdefault(changes[0], []).append(i) + self.refersmf = True + for f in changes[3]: + if match(f): + filelinkrevs.setdefault(_normpath(f), []).append(i) + except Exception as inst: self.refersmf = True - for f in changes[3]: - if match(f): - filelinkrevs.setdefault(_normpath(f), []).append(i) - except Exception as inst: - self.refersmf = True - self._exc(i, _(b"unpacking changeset %s") % short(n), inst) + self._exc(i, _(b"unpacking changeset %s") % short(n), inst) progress.complete() return mflinkrevs, filelinkrevs