hgext/color.py
changeset 19063 7ae12ce87594
parent 18921 ac31f586eff7
child 19072 b7b50a54bec9
--- a/hgext/color.py	Thu Apr 18 20:28:38 2013 +0200
+++ b/hgext/color.py	Thu Apr 18 23:53:24 2013 +0200
@@ -381,13 +381,13 @@
 def uisetup(ui):
     if ui.plain():
         return
+    if not issubclass(ui.__class__, colorui):
+        colorui.__bases__ = (ui.__class__,)
+        ui.__class__ = colorui
     def colorcmd(orig, ui_, opts, cmd, cmdfunc):
         mode = _modesetup(ui_, opts)
         if mode:
             colorui._colormode = mode
-            if not issubclass(ui_.__class__, colorui):
-                colorui.__bases__ = (ui_.__class__,)
-                ui_.__class__ = colorui
             extstyles()
             configstyles(ui_)
         return orig(ui_, opts, cmd, cmdfunc)