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

login
register
mail settings
Submitter Pierre-Yves David
Date May 5, 2016, 5:05 p.m.
Message ID <11839ae148f45e30e51c.1462467952@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/14925/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Pierre-Yves David - May 5, 2016, 5:05 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.

Patch

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.