Patchwork D1494: develwarn: do not emit warning if "config" is unspecified

login
register
mail settings
Submitter phabricator
Date Nov. 23, 2017, 3:35 a.m.
Message ID <differential-rev-PHID-DREV-zrn6ci6ucyhz4lpomy5j-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25727/
State Superseded
Headers show

Comments

phabricator - Nov. 23, 2017, 3:35 a.m.
spectral created this revision.
spectral added a reviewer: yuja.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, if the develwarn call site did not specify the category of warning,
  and devel.all-warnings was False, it would emit the warning.  If it was
  intended that this emit a warning if config is unspecified, I would have
  expected a comment, so I assumed this was unintentional and am changing the
  behavior.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1494

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: spectral, yuja, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 23, 2017, 3:36 a.m.
spectral added a comment.


  (Specifically picked yuja as reviewer since they reviewed the original https://www.mercurial-scm.org/repo/hg/rev/3f33831a9202, so hopefully can tell me whether this was intentional or not and I'm possibly breaking stuff with this change :))

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1494

To: spectral, yuja, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 25, 2017, 3:10 a.m.
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.


  Makes sense. Queued, thanks.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1494

To: spectral, yuja, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 25, 2017, 4:04 a.m.
yuja added a comment.


  > (Specifically picked yuja as reviewer since they reviewed the original
  >  https://www.mercurial-scm.org/repo/hg/rev/3f33831a9202,
  >  so hopefully can tell me whether this was intentional
  
  I think it was intentional during the migration to the config gating API,
  i.e. no gating unless `config=` is specified, but the current behavior is
  weird, and should be worth breaking the old API.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1494

To: spectral, yuja, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1601,7 +1601,7 @@ 
         stack.
         """
         if not self.configbool('devel', 'all-warnings'):
-            if config is not None and not self.configbool('devel', config):
+            if config is None or not self.configbool('devel', config):
                 return
         msg = 'devel-warn: ' + msg
         stacklevel += 1 # get in develwarn