changeset 41877:9c5a6af74afa

verify: small refactoring and documentation in `_verifymanifest` Small changes to make this area of code clearer.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 06 Mar 2019 14:43:02 +0100
parents 5ad5a70df2f7
children 82884bbf8d2b
files mercurial/verify.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/verify.py	Wed Mar 06 12:39:44 2019 +0100
+++ b/mercurial/verify.py	Wed Mar 06 14:43:02 2019 +0100
@@ -334,8 +334,10 @@
             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)