# HG changeset patch # User Pierre-Yves David # Date 1462697021 -7200 # Node ID 3f33831a9202828451bd60e996ae338a533e9e17 # Parent 983353035cec51382257b7cbd599c7fa4da97847 develwarn: move config gating inside the develwarn function The config gating is almost always the same and contributor tend to forget it. We move the logic inside the function. Call site will be updated in later changeset. We might make the sub config mandatory in the future (once all old call sites are gone). diff -r 983353035cec -r 3f33831a9202 mercurial/ui.py --- a/mercurial/ui.py Fri May 06 23:57:56 2016 +0100 +++ b/mercurial/ui.py Sun May 08 10:43:41 2016 +0200 @@ -1135,12 +1135,15 @@ ''' return msg - def develwarn(self, msg, stacklevel=1): + def develwarn(self, msg, stacklevel=1, config=None): """issue a developer warning message Use 'stacklevel' to report the offender some layers further up in the stack. """ + if not self.configbool('devel', 'all-warnings'): + if config is not None and not self.configbool('devel', config): + return msg = 'devel-warn: ' + msg stacklevel += 1 # get in develwarn if self.tracebackflag: