diff mercurial/cmdutil.py @ 4555:1843d31bfdbf

localrepo: don't search from path All current callers already pass in the repo root. This normalizes things a bit. Now all repo types take a direct path to repo root and only the command line interface (or the dispatcher) searches from the current directory.
author Matt Mackall <mpm@selenic.com>
date Mon, 11 Jun 2007 21:09:24 -0500
parents 9dbabb9d466c
children 30bc57094bfc
line wrap: on
line diff
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -255,8 +255,11 @@ def dispatch(ui, args):
     extensions.loadall(ui)
     ui.addreadhook(extensions.loadall)
 
-    # read the local extension info into a local ui object
-    path = earlygetopt(["-R", "--repository"], args) or localrepo.findrepo() or ""
+    # read the local repository .hgrc into a local ui object
+    # this will trigger its extensions to load
+    path = earlygetopt(["-R", "--repository"], args)
+    if not path:
+        path = localrepo.findrepo() or ""
     if path:
         try:
             lui = commands.ui.ui(parentui=ui)
@@ -298,7 +301,7 @@ def dispatch(ui, args):
         repo = None
         try:
             repo = hg.repository(ui, path=path)
-            #ui = repo.ui
+            ui = repo.ui
             if not repo.local():
                 raise util.Abort(_("repository '%s' is not local") % path)
         except hg.RepoError: