Patchwork [2,of,5] color: use valid_effect in configstyles

login
register
mail settings
Submitter Sean Farley
Date April 7, 2014, 8:58 p.m.
Message ID <b1662ae29a5bdaf9c564.1396904294@laptop.local>
Download mbox | patch
Permalink /patch/4245/
State Superseded
Headers show

Comments

Sean Farley - April 7, 2014, 8:58 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396902826 18000
#      Mon Apr 07 15:33:46 2014 -0500
# Node ID b1662ae29a5bdaf9c56485034316a158463e5f07
# Parent  07cabc89783a8ce2fd224b2955fcce6e9ab90c38
color: use valid_effect in configstyles

Patch

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -326,13 +326,11 @@  def configstyles(ui):
             continue
         cfgeffects = ui.configlist('color', status)
         if cfgeffects:
             good = []
             for e in cfgeffects:
-                if not _terminfo_params and e in _effects:
-                    good.append(e)
-                elif e in _terminfo_params or e[:-11] in _terminfo_params:
+                if valid_effect(e):
                     good.append(e)
                 else:
                     ui.warn(_("ignoring unknown color/effect %r "
                               "(configured in color.%s)\n")
                             % (e, status))