--- a/mercurial/cmdutil.py Thu Jun 21 19:38:44 2007 +0200
+++ b/mercurial/cmdutil.py Thu Jun 21 13:09:00 2007 -0500
@@ -262,11 +262,9 @@
os.chdir(cwd)
# read the local repository .hgrc into a local ui object
- # this will trigger its extensions to load
- path = earlygetopt(["-R", "--repository", "--repo"], args)
+ path = findrepo() or ""
if not path:
- path = findrepo() or ""
- lui = ui
+ lui = ui
if path:
try:
lui = commands.ui.ui(parentui=ui)
@@ -274,6 +272,13 @@
except IOError:
pass
+ # now we can expand paths, even ones in .hg/hgrc
+ rpath = earlygetopt(["-R", "--repository", "--repo"], args)
+ if rpath:
+ path = lui.expandpath(rpath)
+ lui = commands.ui.ui(parentui=ui)
+ lui.readconfig(os.path.join(path, ".hg", "hgrc"))
+
extensions.loadall(lui)
# check for fallback encoding
fallback = lui.config('ui', 'fallbackencoding')