##// END OF EJS Templates
dispatch: use the repo path found by early parsing...
Matt Mackall -
r4554:9dbabb9d default
parent child Browse files
Show More
@@ -256,11 +256,11 b' def dispatch(ui, args):'
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 extension info into a local ui object
259 rcpath = earlygetopt(["-R", "--repository"], args) or localrepo.findrepo()
259 path = earlygetopt(["-R", "--repository"], args) or localrepo.findrepo() or ""
260 if rcpath:
260 if path:
261 try:
261 try:
262 lui = commands.ui.ui(parentui=ui)
262 lui = commands.ui.ui(parentui=ui)
263 lui.readconfig(os.path.join(rcpath, ".hg", "hgrc"))
263 lui.readconfig(os.path.join(path, ".hg", "hgrc"))
264 except IOError:
264 except IOError:
265 pass
265 pass
266
266
@@ -287,11 +287,6 b' def dispatch(ui, args):'
287 not options["noninteractive"], options["traceback"],
287 not options["noninteractive"], options["traceback"],
288 parseconfig(options["config"]))
288 parseconfig(options["config"]))
289
289
290 path = ui.expandpath(options["repository"]) or ""
291 repo = path and hg.repository(ui, path=path) or None
292 if repo and not repo.local():
293 raise util.Abort(_("repository '%s' is not local") % path)
294
295 if options['help']:
290 if options['help']:
296 return commands.help_(ui, cmd, options['version'])
291 return commands.help_(ui, cmd, options['version'])
297 elif options['version']:
292 elif options['version']:
@@ -300,10 +295,12 b' def dispatch(ui, args):'
300 return commands.help_(ui, 'shortlist')
295 return commands.help_(ui, 'shortlist')
301
296
302 if cmd not in commands.norepo.split():
297 if cmd not in commands.norepo.split():
298 repo = None
303 try:
299 try:
304 if not repo:
300 repo = hg.repository(ui, path=path)
305 repo = hg.repository(ui, path=path)
301 #ui = repo.ui
306 ui = repo.ui
302 if not repo.local():
303 raise util.Abort(_("repository '%s' is not local") % path)
307 except hg.RepoError:
304 except hg.RepoError:
308 if cmd not in commands.optionalrepo.split():
305 if cmd not in commands.optionalrepo.split():
309 raise
306 raise
@@ -1,6 +1,6 b''
1 # creating 'remote'
1 # creating 'remote'
2 # repo not found error
2 # repo not found error
3 remote: abort: repository nonexistent not found!
3 remote: abort: There is no Mercurial repository here (.hg not found)!
4 abort: no suitable response from remote hg!
4 abort: no suitable response from remote hg!
5 # clone remote via stream
5 # clone remote via stream
6 streaming all changes
6 streaming all changes
General Comments 0
You need to be logged in to leave comments. Login now