# HG changeset patch # User Martin Geisler # Date 1241291377 -7200 # Node ID 1f9787de17d98a25abff8a0d90ef398bc45de9bf # Parent b9403042968adbb58916e17a09689b506bb58394 color: look for mq with extensions.find diff -r b9403042968a -r 1f9787de17d9 hgext/color.py --- 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'''