debugextension: change "testedwith" to a list (BC)
authorYuya Nishihara <yuya@tcha.org>
Sat, 19 Mar 2016 17:19:03 -0700
changeset 29703 3ef9aa7ad1fc
parent 29702 d29fbf97cc9f
child 29705 41689e293994
debugextension: change "testedwith" to a list (BC) It wasn't a list since the formatter couldn't process a list. We have no such problem now and the -T option is experimental, so we can change it.
mercurial/commands.py
tests/test-debugextensions.t
--- a/mercurial/commands.py	Sun Jul 10 22:07:34 2016 +0900
+++ b/mercurial/commands.py	Sat Mar 19 17:19:03 2016 -0700
@@ -2423,7 +2423,8 @@
                  _('  location: %s\n'), extsource or "")
 
         fm.condwrite(ui.verbose and exttestedwith, 'testedwith',
-                 _('  tested with: %s\n'), ' '.join(exttestedwith))
+                     _('  tested with: %s\n'),
+                     fm.formatlist(exttestedwith, name='ver'))
 
         fm.condwrite(ui.verbose and extbuglink, 'buglink',
                  _('  bug reporting: %s\n'), extbuglink or "")
--- a/tests/test-debugextensions.t	Sun Jul 10 22:07:34 2016 +0900
+++ b/tests/test-debugextensions.t	Sat Mar 19 17:19:03 2016 -0700
@@ -48,36 +48,39 @@
     "buglink": "",
     "name": "color",
     "source": "*/hgext/color.py*", (glob)
-    "testedwith": "internal"
+    "testedwith": ["internal"]
    },
    {
     "buglink": "",
     "name": "ext1",
     "source": "*/extwithoutinfos.py*", (glob)
-    "testedwith": ""
+    "testedwith": []
    },
    {
     "buglink": "",
     "name": "histedit",
     "source": "*/hgext/histedit.py*", (glob)
-    "testedwith": "internal"
+    "testedwith": ["internal"]
    },
    {
     "buglink": "",
     "name": "mq",
     "source": "*/hgext/mq.py*", (glob)
-    "testedwith": "internal"
+    "testedwith": ["internal"]
    },
    {
     "buglink": "",
     "name": "patchbomb",
     "source": "*/hgext/patchbomb.py*", (glob)
-    "testedwith": "internal"
+    "testedwith": ["internal"]
    },
    {
     "buglink": "",
     "name": "rebase",
     "source": "*/hgext/rebase.py*", (glob)
-    "testedwith": "internal"
+    "testedwith": ["internal"]
    }
   ]
+
+  $ hg debugextensions -T '{ifcontains("internal", testedwith, "", "{name}\n")}'
+  ext1