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

login
register
mail settings
Submitter Pierre-Yves David
Date March 6, 2019, 4:29 p.m.
Message ID <33e3e6c86203f9ddecff.1551889764@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39102/
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 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.

Patch

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