[PATCH 2 of 7] devel: use the new 'config' argument of the develwarn in deprecwarn

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu May 5 13:05:52 EDT 2016


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1462465743 -7200
#      Thu May 05 18:29:03 2016 +0200
# Node ID 11839ae148f45e30e51ca34b72ba159343e9dad9
# Parent  4e60a6b778f63b58e62849999d70660c8d29cf8f
# EXP-Topic develwarn
devel: use the new 'config' argument of the develwarn  in deprecwarn

Controling all deprecation warnings with the same config seems sensible. This
mirror a fix (about missing gating) submitted for stable but with the new API.

diff -r 4e60a6b778f6 -r 11839ae148f4 mercurial/ui.py
--- a/mercurial/ui.py	Thu May 05 15:57:48 2016 +0200
+++ b/mercurial/ui.py	Thu May 05 18:29:03 2016 +0200
@@ -1166,7 +1166,7 @@ class ui(object):
         """
         msg += ("\n(compatibility will be dropped after Mercurial-%s,"
                 " update your code.)") % version
-        self.develwarn(msg, stacklevel=2)
+        self.develwarn(msg, stacklevel=2, config='deprec-warn')
 
 class paths(dict):
     """Represents a collection of paths and their configs.


More information about the Mercurial-devel mailing list