# HG changeset patch # User Yuya Nishihara # Date 2016-08-26 14:31:17 # Node ID 4c28ddda5d481886157f52bb2fce7928435d4892 # Parent b64eaf947632fbc05f9d9fa00c04469202cecd97 debugextensions: hide "ships-with-hg-core" magic string (BC) Since we have "bundled" flag, we no longer need to rephrase "ships-with-hg-core" to show as "internal". diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2396,11 +2396,10 @@ def debugextensions(ui, **opts): for extname, extmod in sorted(exts, key=operator.itemgetter(0)): isinternal = extensions.ismoduleinternal(extmod) extsource = extmod.__file__ - exttestedwith = getattr(extmod, 'testedwith', '').split() if isinternal: - showtestedwith = ['internal'] + exttestedwith = [] # never expose magic string to users else: - showtestedwith = exttestedwith + exttestedwith = getattr(extmod, 'testedwith', '').split() extbuglink = getattr(extmod, 'buglink', None) fm.startitem() @@ -2409,10 +2408,10 @@ def debugextensions(ui, **opts): fm.write('name', '%s\n', extname) else: fm.write('name', '%s', extname) - if not exttestedwith: + if isinternal or hgver in exttestedwith: + fm.plain('\n') + elif not exttestedwith: fm.plain(_(' (untested!)\n')) - elif isinternal or hgver in exttestedwith: - fm.plain('\n') else: lasttestedversion = exttestedwith[-1] fm.plain(' (%s!)\n' % lasttestedversion) @@ -2424,9 +2423,9 @@ def debugextensions(ui, **opts): fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal]) fm.data(bundled=isinternal) - fm.condwrite(ui.verbose and showtestedwith, 'testedwith', + fm.condwrite(ui.verbose and exttestedwith, 'testedwith', _(' tested with: %s\n'), - fm.formatlist(showtestedwith, name='ver')) + fm.formatlist(exttestedwith, name='ver')) fm.condwrite(ui.verbose and extbuglink, 'buglink', _(' bug reporting: %s\n'), extbuglink or "") diff --git a/tests/test-debugextensions.t b/tests/test-debugextensions.t --- a/tests/test-debugextensions.t +++ b/tests/test-debugextensions.t @@ -33,7 +33,6 @@ color location: */hgext/color.py* (glob) bundled: yes - tested with: internal ext1 location: */extwithoutinfos.py* (glob) bundled: no @@ -45,19 +44,15 @@ histedit location: */hgext/histedit.py* (glob) bundled: yes - tested with: internal mq location: */hgext/mq.py* (glob) bundled: yes - tested with: internal patchbomb location: */hgext/patchbomb.py* (glob) bundled: yes - tested with: internal rebase location: */hgext/rebase.py* (glob) bundled: yes - tested with: internal $ hg debugextensions -Tjson | sed 's|\\\\|/|g' [ @@ -66,7 +61,7 @@ "bundled": true, "name": "color", "source": "*/hgext/color.py*", (glob) - "testedwith": ["internal"] + "testedwith": [] }, { "buglink": "", @@ -87,28 +82,28 @@ "bundled": true, "name": "histedit", "source": "*/hgext/histedit.py*", (glob) - "testedwith": ["internal"] + "testedwith": [] }, { "buglink": "", "bundled": true, "name": "mq", "source": "*/hgext/mq.py*", (glob) - "testedwith": ["internal"] + "testedwith": [] }, { "buglink": "", "bundled": true, "name": "patchbomb", "source": "*/hgext/patchbomb.py*", (glob) - "testedwith": ["internal"] + "testedwith": [] }, { "buglink": "", "bundled": true, "name": "rebase", "source": "*/hgext/rebase.py*", (glob) - "testedwith": ["internal"] + "testedwith": [] } ]