[PATCH 09 of 18 "] verify: add some inline documentation to the top level `verify` method

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Mar 6 11:29:25 EST 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1551869001 -3600
#      Wed Mar 06 11:43:21 2019 +0100
# Node ID 8092d6de83c346e069322eede70baa05896744d3
# Parent  33e3e6c86203f9ddecff5843b51bd6b43b5883ec
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8092d6de83c3
verify: add some inline documentation to the top level `verify` method

The goal is to clarify each section goal.

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -135,10 +135,9 @@ class verifier(object):
         This method run all verifications, displaying issues as they are found.
 
         return 1 if any error have been encountered, 0 otherwise."""
+        # initial validation and generic report
         repo = self.repo
-
         ui = repo.ui
-
         if not repo.url().startswith('file:'):
             raise error.Abort(_("cannot verify bundle or remote repos"))
 
@@ -149,15 +148,14 @@ class verifier(object):
             ui.status(_("repository uses revlog format %d\n") %
                            (self.revlogv1 and 1 or 0))
 
+        # data verification
         mflinkrevs, filelinkrevs = self._verifychangelog()
-
         filenodes = self._verifymanifest(mflinkrevs)
         del mflinkrevs
-
         self._crosscheckfiles(filelinkrevs, filenodes)
-
         totalfiles, filerevisions = self._verifyfiles(filenodes, filelinkrevs)
 
+        # final report
         ui.status(_("checked %d changesets with %d changes to %d files\n") %
                        (len(repo.changelog), filerevisions, totalfiles))
         if self.warnings:


More information about the Mercurial-devel mailing list