Message3387

Author mpm
Recipients ThomasAH, alexis, brendan, cboos, greg1
Date 2007-06-28.15:15:39
Content
Here's a fix I'm testing:

diff -r cf8b8f62688a mercurial/commands.py
--- a/mercurial/commands.py     Mon Jun 25 21:23:24 2007 -0500
+++ b/mercurial/commands.py     Thu Jun 28 10:14:22 2007 -0500
@@ -3094,6 +3094,8 @@ table = {
     "version": (version_, [], _('hg version')),
 }

+extensions.commandtable = table
+
 norepo = ("clone init version help debugancestor debugcomplete
 debugdata"
           " debugindex debugindexdot debugdate debuginstall")
 optionalrepo = ("paths serve showconfig")
diff -r cf8b8f62688a mercurial/extensions.py
--- a/mercurial/extensions.py   Mon Jun 25 21:23:24 2007 -0500
+++ b/mercurial/extensions.py   Thu Jun 28 10:14:23 2007 -0500
@@ -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")
diff -r cf8b8f62688a mercurial/hg.py
--- a/mercurial/hg.py   Mon Jun 25 21:23:24 2007 -0500
+++ b/mercurial/hg.py   Thu Jun 28 10:14:23 2007 -0500
@@ -10,7 +10,7 @@ from repo import *
 from repo import *
 from i18n import _
 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
-import errno, lock, os, shutil, util, cmdutil
+import errno, lock, os, shutil, util, cmdutil, extensions
 import merge as _merge
 import verify as _verify

@@ -50,13 +50,11 @@ def islocal(repo):
             return False
     return repo.local()

-repo_setup_hooks = []
-
 def repository(ui, path='', create=False):
     """return a repository object for the specified path"""
     repo = _lookup(path).instance(ui, path, create)
     ui = getattr(repo, "ui", ui)
-    for hook in repo_setup_hooks:
+    for hook in extensions.setuphooks:
         hook(ui, repo)
     return repo
History
Date User Action Args
2007-06-28 15:15:40mpmsetrecipients: + ThomasAH
2007-06-28 15:15:40mpmlinkissue605 messages
2007-06-28 15:15:39mpmcreate