Patchwork [1,of,2] color: only provide the required opt to _modesetup

login
register
mail settings
Submitter Simon Heimberg
Date June 5, 2013, 9:19 p.m.
Message ID <c6aff923ecc418577244.1370467149@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1705/
State Accepted
Commit 8ddc3cd962babca12e774e9ae6df7179bc6c39b4
Headers show

Comments

Simon Heimberg - June 5, 2013, 9:19 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1370462762 -7200
# Node ID c6aff923ecc418577244e7c3f1e73b6ba8804154
# Parent  e86d687ad178ce543d6b263eefdcaed6ec8062bb
color: only provide the required opt to _modesetup

Patch

diff -r e86d687ad178 -r c6aff923ecc4 hgext/color.py
--- a/hgext/color.py	Mit Jun 05 22:05:29 2013 +0200
+++ b/hgext/color.py	Mit Jun 05 22:06:02 2013 +0200
@@ -159,10 +159,9 @@ 
               "ECMA-48 color\n"))
         _terminfo_params = {}
 
-def _modesetup(ui, opts):
+def _modesetup(ui, coloropt):
     global _terminfo_params
 
-    coloropt = opts['color']
     auto = coloropt == 'auto'
     always = not auto and util.parsebool(coloropt)
     if not always and not auto:
@@ -405,7 +404,7 @@ 
         colorui.__bases__ = (ui.__class__,)
         ui.__class__ = colorui
     def colorcmd(orig, ui_, opts, cmd, cmdfunc):
-        mode = _modesetup(ui_, opts)
+        mode = _modesetup(ui_, opts['color'])
         colorui._colormode = mode
         if mode:
             extstyles()