Mercurial > hg
changeset 29082:77de985d7c91 stable
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 05 May 2016 16:29:31 +0200 |
parents | e6f490e32863 |
children | af6d4a49e361 222b8170d69e |
files | mercurial/ui.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Wed May 04 22:44:30 2016 -0400 +++ 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)