Patchwork [17,of,18,"] verify: small refactoring and documentation in `_verifymanifest`

login
register
mail settings
Submitter Pierre-Yves David
Date March 6, 2019, 4:29 p.m.
Message ID <92091b3de1503bf562fe.1551889773@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39106/
State Accepted
Headers show

Comments

Pierre-Yves David - March 6, 2019, 4:29 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1551879782 -3600
#      Wed Mar 06 14:43:02 2019 +0100
# Node ID 92091b3de1503bf562fe5bf2b544781f92702738
# Parent  a6b80a595d5e6a94e13d08150636faa0ca4729e5
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 92091b3de150
verify: small refactoring and documentation in `_verifymanifest`

Small changes to make this area of code clearer.

Patch

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -334,8 +334,10 @@  class verifier(object):
             progress.complete()
 
         if self.havemf:
-            for c, m in sorted([(c, m) for m in mflinkrevs
-                        for c in mflinkrevs[m]]):
+            # since we delete entry in `mflinkrevs` during iteration, any
+            # remaining entries are "missing". We need to issue errors for them.
+            changesetpairs = [(c, m) for m in mflinkrevs for c in mflinkrevs[m]]
+            for c, m in sorted(changesetpairs):
                 if dir:
                     self._err(c, _("parent-directory manifest refers to unknown"
                                    " revision %s") % short(m), label)