# HG changeset patch # User Matt Mackall # Date 1181614164 18000 # Node ID 1843d31bfdbfdc761a6519d999e9805f0c9d8aba # Parent 9dbabb9d466c57f649cdbbc0be158abee44a9da5 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. diff -r 9dbabb9d466c -r 1843d31bfdbf mercurial/cmdutil.py --- a/mercurial/cmdutil.py Mon Jun 11 21:09:24 2007 -0500 +++ b/mercurial/cmdutil.py Mon Jun 11 21:09:24 2007 -0500 @@ -255,8 +255,11 @@ 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 @@ 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: diff -r 9dbabb9d466c -r 1843d31bfdbf mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jun 11 21:09:24 2007 -0500 +++ b/mercurial/localrepo.py Mon Jun 11 21:09:24 2007 -0500 @@ -29,12 +29,7 @@ self.transhandle = None def __init__(self, parentui, path=None, create=0): repo.repository.__init__(self) - if not path: - path = findrepo() - if not path: - raise repo.RepoError(_("There is no Mercurial repository" - " here (.hg not found)")) - + self.path = path self.root = os.path.realpath(path) self.path = os.path.join(self.root, ".hg") self.origroot = path