hgext/color.py
changeset 9711 d29bd00bbc50
parent 9641 9b99f158348a
child 10004 af04a3dea4cd
--- a/hgext/color.py	Thu Nov 05 01:10:43 2009 +0100
+++ b/hgext/color.py	Thu Nov 05 01:11:28 2009 +0100
@@ -235,7 +235,7 @@
                  'changed': ['white'],
                  'trailingwhitespace': ['bold', 'red_background']}
 
-def uisetup(ui):
+def extsetup(ui):
     '''Initialize the extension.'''
     _setupcmd(ui, 'diff', commands.table, colordiff, _diff_effects)
     _setupcmd(ui, 'incoming', commands.table, None, _diff_effects)
@@ -249,15 +249,17 @@
         _setupcmd(ui, 'qdiff', mq.cmdtable, colordiff, _diff_effects)
         _setupcmd(ui, 'qseries', mq.cmdtable, colorqseries, _patch_effects)
     except KeyError:
-        # The mq extension is not enabled
-        pass
+        mq = None
 
     try:
         rec = extensions.find('record')
         _setupcmd(ui, 'record', rec.cmdtable, colordiff, _diff_effects)
     except KeyError:
-        # The record extension is not enabled
-        pass
+        rec = None
+
+    if mq and rec:
+        _setupcmd(ui, 'qrecord', rec.cmdtable, colordiff, _diff_effects)
+
 
 def _setupcmd(ui, cmd, table, func, effectsmap):
     '''patch in command to command table and load effect map'''