diff mercurial/commands.py @ 4068:5b1f663ef86d

Merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 06 Feb 2007 16:12:22 -0600
parents 431f3c1d3a37 5d9ede002453
children e6d26e71f049
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Feb 06 15:23:40 2007 -0200
+++ b/mercurial/commands.py	Tue Feb 06 16:12:22 2007 -0600
@@ -2486,7 +2486,7 @@
     command.
     """
     if os.path.exists(fname):
-        f = open(fname)
+        f = open(fname, "rb")
     else:
         f = urllib.urlopen(fname)
     gen = changegroup.readbundle(f, fname)
@@ -3069,6 +3069,9 @@
         uisetup = getattr(mod, 'uisetup', None)
         if uisetup:
             uisetup(ui)
+        reposetup = getattr(mod, 'reposetup', None)
+        if reposetup:
+            hg.repo_setup_hooks.append(reposetup)
         cmdtable = getattr(mod, 'cmdtable', {})
         overrides = [cmd for cmd in cmdtable if cmd in table]
         if overrides:
@@ -3152,11 +3155,6 @@
                     if not repo:
                         repo = hg.repository(u, path=path)
                     u = repo.ui
-                    for name in external.itervalues():
-                        mod = sys.modules[name]
-                        if hasattr(mod, 'reposetup'):
-                            mod.reposetup(u, repo)
-                            hg.repo_setup_hooks.append(mod.reposetup)
                 except hg.RepoError:
                     if cmd not in optionalrepo.split():
                         raise