hgext/color.py
changeset 8278 1f9787de17d9
parent 7988 0447939b4b97
child 8622 0a4f6e1b78dc
--- a/hgext/color.py	Sat May 02 19:13:29 2009 +0200
+++ b/hgext/color.py	Sat May 02 21:09:37 2009 +0200
@@ -232,11 +232,13 @@
     _setupcmd(ui, 'outgoing', commands.table, None, _diff_effects)
     _setupcmd(ui, 'tip', commands.table, None, _diff_effects)
     _setupcmd(ui, 'status', commands.table, colorstatus, _status_effects)
-    if ui.config('extensions', 'hgext.mq') is not None or \
-            ui.config('extensions', 'mq') is not None:
-        from hgext import mq
+    try:
+        mq = extensions.find('mq')
         _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
 
 def _setupcmd(ui, cmd, table, func, effectsmap):
     '''patch in command to command table and load effect map'''