diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -420,12 +420,12 @@ def _getlocal(ui, rpath): lui = ui else: lui = ui.copy() - lui.readconfig(os.path.join(path, ".hg", "hgrc")) + lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) if rpath: path = lui.expandpath(rpath[-1]) lui = ui.copy() - lui.readconfig(os.path.join(path, ".hg", "hgrc")) + lui.readconfig(os.path.join(path, ".hg", "hgrc"), path) return path, lui diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -20,6 +20,10 @@ updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd c + $ cat >> .hg/hgrc < [paths] + > relative = ../a + > EOF $ hg pull -f ../b pulling from ../b searching for changes @@ -59,11 +63,17 @@ Testing -R/--repository: $ hg -R file://localhost/`pwd`/a/ identify 8580ff50825a tip --R with a path alias: +-R with path aliases: $ cd c $ hg -R default identify 8580ff50825a tip + $ hg -R relative identify + 8580ff50825a tip + $ echo '[paths]' >> $HGRCPATH + $ echo 'relativetohome = a' >> $HGRCPATH + $ HOME=`pwd`/../ hg -R relativetohome identify + 8580ff50825a tip $ cd .. Implicit -R: