[PATCH STABLE] deprecation: gate deprecation warning behind devel configuration

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 5 14:36:53 UTC 2016


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1462458571 -7200
#      Thu May 05 16:29:31 2016 +0200
# Branch stable
# Node ID 332d908d7b8a07ed3885fef9ffcc95ac99597e5f
# Parent  61463b8fcef871ff3efff53945df4671c71c4e31
# EXP-Topic deprecwarn
deprecation: gate deprecation warning behind devel configuration

Regular users are not supposed to be exposed to the API deprecation warnings.
We now only issue them when the developper warnings are enabled.

diff -r 61463b8fcef8 -r 332d908d7b8a mercurial/ui.py
--- a/mercurial/ui.py	Sun May 01 14:36:12 2016 -0500
+++ b/mercurial/ui.py	Thu May 05 16:29:31 2016 +0200
@@ -1161,6 +1161,9 @@
         - msg: message explaining what is deprecated and how to upgrade,
         - version: last version where the API will be supported,
         """
+        if not (self.configbool('devel', 'all-warnings')
+                or self.configbool('devel', 'deprec-warn')):
+            return
         msg += ("\n(compatibility will be dropped after Mercurial-%s,"
                 " update your code.)") % version
         self.develwarn(msg, stacklevel=2)


More information about the Mercurial-devel mailing list