Mercurial > hg
comparison mercurial/ui.py @ 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 | ad2cd2ef25d9 |
children | 3f33831a9202 |
comparison
equal
deleted
inserted
replaced
29066:e6f490e32863 | 29082:77de985d7c91 |
---|---|
1159 """issue a deprecation warning | 1159 """issue a deprecation warning |
1160 | 1160 |
1161 - msg: message explaining what is deprecated and how to upgrade, | 1161 - msg: message explaining what is deprecated and how to upgrade, |
1162 - version: last version where the API will be supported, | 1162 - version: last version where the API will be supported, |
1163 """ | 1163 """ |
1164 if not (self.configbool('devel', 'all-warnings') | |
1165 or self.configbool('devel', 'deprec-warn')): | |
1166 return | |
1164 msg += ("\n(compatibility will be dropped after Mercurial-%s," | 1167 msg += ("\n(compatibility will be dropped after Mercurial-%s," |
1165 " update your code.)") % version | 1168 " update your code.)") % version |
1166 self.develwarn(msg, stacklevel=2) | 1169 self.develwarn(msg, stacklevel=2) |
1167 | 1170 |
1168 class paths(dict): | 1171 class paths(dict): |