Patchwork [1,of,4] debugextensions: simply keep testedwith variable as a list

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 4, 2016, 4:13 p.m.
Message ID <68800e79b8d859871ab6.1470327197@mimosa>
Download mbox | patch
Permalink /patch/16087/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 4, 2016, 4:13 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1468155583 -32400
#      Sun Jul 10 21:59:43 2016 +0900
# Node ID 68800e79b8d859871ab65c731ce127b7026dfac4
# Parent  f15f31505f12bff1e0401ee63d3420ee157afc95
debugextensions: simply keep testedwith variable as a list

There should be no need to distinguish [] and None.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2401,9 +2401,7 @@  def debugextensions(ui, **opts):
     fm = ui.formatter('debugextensions', opts)
     for extname, extmod in sorted(exts, key=operator.itemgetter(0)):
         extsource = extmod.__file__
-        exttestedwith = getattr(extmod, 'testedwith', None)
-        if exttestedwith is not None:
-            exttestedwith = exttestedwith.split()
+        exttestedwith = getattr(extmod, 'testedwith', '').split()
         extbuglink = getattr(extmod, 'buglink', None)
 
         fm.startitem()
@@ -2426,7 +2424,7 @@  def debugextensions(ui, **opts):
                  _('  location: %s\n'), extsource or "")
 
         fm.condwrite(ui.verbose and exttestedwith, 'testedwith',
-                 _('  tested with: %s\n'), ' '.join(exttestedwith or []))
+                 _('  tested with: %s\n'), ' '.join(exttestedwith))
 
         fm.condwrite(ui.verbose and extbuglink, 'buglink',
                  _('  bug reporting: %s\n'), extbuglink or "")