changeset 8278:1f9787de17d9

color: look for mq with extensions.find
author Martin Geisler <mg@lazybytes.net>
date Sat, 02 May 2009 21:09:37 +0200
parents b9403042968a
children 602ed4982f36
files hgext/color.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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'''