Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
4554:9dbabb9d466c | 4555:1843d31bfdbf |
---|---|
253 os.chdir(cwd) | 253 os.chdir(cwd) |
254 | 254 |
255 extensions.loadall(ui) | 255 extensions.loadall(ui) |
256 ui.addreadhook(extensions.loadall) | 256 ui.addreadhook(extensions.loadall) |
257 | 257 |
258 # read the local extension info into a local ui object | 258 # read the local repository .hgrc into a local ui object |
259 path = earlygetopt(["-R", "--repository"], args) or localrepo.findrepo() or "" | 259 # this will trigger its extensions to load |
260 path = earlygetopt(["-R", "--repository"], args) | |
261 if not path: | |
262 path = localrepo.findrepo() or "" | |
260 if path: | 263 if path: |
261 try: | 264 try: |
262 lui = commands.ui.ui(parentui=ui) | 265 lui = commands.ui.ui(parentui=ui) |
263 lui.readconfig(os.path.join(path, ".hg", "hgrc")) | 266 lui.readconfig(os.path.join(path, ".hg", "hgrc")) |
264 except IOError: | 267 except IOError: |
296 | 299 |
297 if cmd not in commands.norepo.split(): | 300 if cmd not in commands.norepo.split(): |
298 repo = None | 301 repo = None |
299 try: | 302 try: |
300 repo = hg.repository(ui, path=path) | 303 repo = hg.repository(ui, path=path) |
301 #ui = repo.ui | 304 ui = repo.ui |
302 if not repo.local(): | 305 if not repo.local(): |
303 raise util.Abort(_("repository '%s' is not local") % path) | 306 raise util.Abort(_("repository '%s' is not local") % path) |
304 except hg.RepoError: | 307 except hg.RepoError: |
305 if cmd not in commands.optionalrepo.split(): | 308 if cmd not in commands.optionalrepo.split(): |
306 raise | 309 raise |