changeset 29897:4c28ddda5d48

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".
author Yuya Nishihara <yuya@tcha.org>
date Fri, 26 Aug 2016 23:31:17 +0900
parents b64eaf947632
children 02c150850e16
files mercurial/commands.py tests/test-debugextensions.t
diffstat 2 files changed, 12 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Aug 31 23:22:07 2016 +0900
+++ b/mercurial/commands.py	Fri Aug 26 23:31:17 2016 +0900
@@ -2396,11 +2396,10 @@
     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 @@
             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 @@
             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 "")
--- a/tests/test-debugextensions.t	Wed Aug 31 23:22:07 2016 +0900
+++ b/tests/test-debugextensions.t	Fri Aug 26 23:31:17 2016 +0900
@@ -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": []
    }
   ]