Patchwork D1719: debug: remove an 'if ui.debug()' that is not doing anything

login
register
mail settings
Submitter phabricator
Date Dec. 19, 2017, 1:48 a.m.
Message ID <differential-rev-PHID-DREV-cs3lzyzubv477ilf2crl-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/26342/
State Superseded
Headers show

Comments

phabricator - Dec. 19, 2017, 1:48 a.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  ui.debug() does not return a value.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 19, 2017, 3:48 a.m.
quark added a comment.


  I think it should be `ui.debugflag`.

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - Dec. 19, 2017, 4 a.m.
spectral added a comment.


  In https://phab.mercurial-scm.org/D1719#29390, @quark wrote:
  
  > I think it should be `ui.debugflag`.
  
  
  I agree that's probably what was intended, but is it helpful to have it if it's never once been activated in 5 years?  (added: https://phab.mercurial-scm.org/rHG4bec77e62c00b45912c41e5e76bfc994d6692133, 2012-12-13).  (Ironically, if I ever actually ran this command I'd probably want it to have the behavior I'm deleting, but considering no one else has wanted it enough to fix the issue here, it feels too much like dead code/YAGNI for my tastes)

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers
Cc: quark, mercurial-devel
phabricator - Dec. 21, 2017, 10:50 p.m.
krbullock accepted this revision.
krbullock added a comment.
This revision is now accepted and ready to land.


  Seems reasonable.

REPOSITORY
  rHG Mercurial

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

To: spectral, #hg-reviewers, krbullock
Cc: krbullock, quark, mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2305,10 +2305,6 @@ 
     cache = {}
     ctx2str = str
     node2str = short
-    if ui.debug():
-        def ctx2str(ctx):
-            return ctx.hex()
-        node2str = hex
     for rev in scmutil.revrange(repo, revs):
         ctx = repo[rev]
         ui.write('%s\n'% ctx2str(ctx))