changeset 29884:ed793f41e83f

extensions: use ismoduleinternal() thoroughly "ships-with-hg-core" would be long enough to typo.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 27 Aug 2016 00:00:28 +0900
parents 0c8c388c7d62
children 42751543fa06
files mercurial/commands.py mercurial/dispatch.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Aug 30 09:25:00 2016 -0700
+++ b/mercurial/commands.py	Sat Aug 27 00:00:28 2016 +0900
@@ -2394,9 +2394,10 @@
     hgver = util.version()
     fm = ui.formatter('debugextensions', opts)
     for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
+        isinternal = extensions.ismoduleinternal(extmod)
         extsource = extmod.__file__
         exttestedwith = getattr(extmod, 'testedwith', '').split()
-        if exttestedwith == ['ships-with-hg-core']:
+        if isinternal:
             showtestedwith = ['internal']
         else:
             showtestedwith = exttestedwith
@@ -2410,8 +2411,7 @@
             fm.write('name', '%s', extname)
             if not exttestedwith:
                 fm.plain(_(' (untested!)\n'))
-            elif (exttestedwith == ['ships-with-hg-core']
-                  or hgver in exttestedwith):
+            elif isinternal or hgver in exttestedwith:
                 fm.plain('\n')
             else:
                 lasttestedversion = exttestedwith[-1]
--- a/mercurial/dispatch.py	Tue Aug 30 09:25:00 2016 -0700
+++ b/mercurial/dispatch.py	Sat Aug 27 00:00:28 2016 +0900
@@ -929,7 +929,7 @@
                 break
 
             # Never blame on extensions bundled with Mercurial.
-            if testedwith == 'ships-with-hg-core':
+            if extensions.ismoduleinternal(mod):
                 continue
 
             tested = [util.versiontuple(t, 2) for t in testedwith.split()]