[PATCH 2 of 3] debugextensions: show raw testedwith value (BC)

Yuya Nishihara yuya at tcha.org
Tue Aug 30 11:10:13 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1472221877 -32400
#      Fri Aug 26 23:31:17 2016 +0900
# Node ID 8bae198823d55c18e640f22df8c8ef89f50fd998
# Parent  4c32b2f6aa852fc6260d63bb359d6b2129b8bede
debugextensions: show raw testedwith value (BC)

Otherwise we would see no difference between "internal" liar and real
"ships-with-hg-core".

This is a debug command. There would be no need to keep backward compatibility.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2397,10 +2397,6 @@ def debugextensions(ui, **opts):
         isinternal = extensions.ismoduleinternal(extmod)
         extsource = extmod.__file__
         exttestedwith = getattr(extmod, 'testedwith', '').split()
-        if isinternal:
-            showtestedwith = ['internal']
-        else:
-            showtestedwith = exttestedwith
         extbuglink = getattr(extmod, 'buglink', None)
 
         fm.startitem()
@@ -2420,9 +2416,9 @@ def debugextensions(ui, **opts):
         fm.condwrite(ui.verbose and extsource, 'source',
                  _('  location: %s\n'), extsource or "")
 
-        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
@@ -26,21 +26,21 @@
   $ hg debugextensions -v
   color
     location: */hgext/color.py* (glob)
-    tested with: internal
+    tested with: ships-with-hg-core
   ext1
     location: */extwithoutinfos.py* (glob)
   histedit
     location: */hgext/histedit.py* (glob)
-    tested with: internal
+    tested with: ships-with-hg-core
   mq
     location: */hgext/mq.py* (glob)
-    tested with: internal
+    tested with: ships-with-hg-core
   patchbomb
     location: */hgext/patchbomb.py* (glob)
-    tested with: internal
+    tested with: ships-with-hg-core
   rebase
     location: */hgext/rebase.py* (glob)
-    tested with: internal
+    tested with: ships-with-hg-core
 
   $ hg debugextensions -Tjson | sed 's|\\\\|/|g'
   [
@@ -48,7 +48,7 @@
     "buglink": "",
     "name": "color",
     "source": "*/hgext/color.py*", (glob)
-    "testedwith": ["internal"]
+    "testedwith": ["ships-with-hg-core"]
    },
    {
     "buglink": "",
@@ -60,27 +60,28 @@
     "buglink": "",
     "name": "histedit",
     "source": "*/hgext/histedit.py*", (glob)
-    "testedwith": ["internal"]
+    "testedwith": ["ships-with-hg-core"]
    },
    {
     "buglink": "",
     "name": "mq",
     "source": "*/hgext/mq.py*", (glob)
-    "testedwith": ["internal"]
+    "testedwith": ["ships-with-hg-core"]
    },
    {
     "buglink": "",
     "name": "patchbomb",
     "source": "*/hgext/patchbomb.py*", (glob)
-    "testedwith": ["internal"]
+    "testedwith": ["ships-with-hg-core"]
    },
    {
     "buglink": "",
     "name": "rebase",
     "source": "*/hgext/rebase.py*", (glob)
-    "testedwith": ["internal"]
+    "testedwith": ["ships-with-hg-core"]
    }
   ]
 
-  $ hg debugextensions -T '{ifcontains("internal", testedwith, "", "{name}\n")}'
+  $ hg debugextensions \
+  > -T '{ifcontains("ships-with-hg-core", testedwith, "", "{name}\n")}'
   ext1


More information about the Mercurial-devel mailing list