[PATCH 08 of 18 "] verify: explicitly return 0 if no error are encountered

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


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1551868734 -3600
#      Wed Mar 06 11:38:54 2019 +0100
# Node ID 33e3e6c86203f9ddecff5843b51bd6b43b5883ec
# Parent  feeaebe5aa639ce0d8df7e42ea2540046565aee5
# EXP-Topic verify
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 33e3e6c86203
verify: explicitly return 0 if no error are encountered

Relying on the fact None is treated as 0 by other logics seems smarter than we
should be.

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -134,7 +134,7 @@ class verifier(object):
 
         This method run all verifications, displaying issues as they are found.
 
-        return 1 if any error have been encountered"""
+        return 1 if any error have been encountered, 0 otherwise."""
         repo = self.repo
 
         ui = repo.ui
@@ -171,6 +171,7 @@ class verifier(object):
                 ui.warn(_("(first damaged changeset appears to be %d)\n")
                         % min(self.badrevs))
             return 1
+        return 0
 
     def _verifychangelog(self):
         ui = self.ui


More information about the Mercurial-devel mailing list