diff mercurial/extensions.py @ 4819:616a5adbf402

extensions: untangle some recursive dependencies
author Matt Mackall <mpm@selenic.com>
date Thu, 05 Jul 2007 15:37:23 -0500
parents 63b9d2deed48
children af0995261f02
line wrap: on
line diff
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -6,10 +6,12 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 import imp, os
-import commands, hg, util, sys
+import util, sys
 from i18n import _
 
 _extensions = {}
+commandtable = {}
+setuphooks = []
 
 def find(name):
     '''return module with given extension name'''
@@ -54,13 +56,13 @@ def load(ui, name, path):
         uisetup(ui)
     reposetup = getattr(mod, 'reposetup', None)
     if reposetup:
-        hg.repo_setup_hooks.append(reposetup)
+        setuphooks.append(reposetup)
     cmdtable = getattr(mod, 'cmdtable', {})
-    overrides = [cmd for cmd in cmdtable if cmd in commands.table]
+    overrides = [cmd for cmd in cmdtable if cmd in commandtable]
     if overrides:
         ui.warn(_("extension '%s' overrides commands: %s\n")
                 % (name, " ".join(overrides)))
-    commands.table.update(cmdtable)
+    commandtable.update(cmdtable)
 
 def loadall(ui):
     result = ui.configitems("extensions")