comparison mercurial/dispatch.py @ 13447:931a72e00efa stable

introduce new RequirementError (issue2649) This improves the misleading error message $ hg identify abort: there is no Mercurial repository here (.hg not found)! to the more explicit $ hg identify abort: requirement 'fake' not supported! for all commands in commands.optionalrepo, which includes the identify and serve commands in particular. This is for the case when a new entry in .hg/requires will be defined in a future Mercurial release.
author Adrian Buehlmann <adrian@cadifra.com>
date Fri, 18 Feb 2011 20:25:25 +0100
parents ed720c7cc97d
children 14d0553bd48b
comparison
equal deleted inserted replaced
13446:1e497df514e2 13447:931a72e00efa
574 repo = hg.repository(ui, path=path) 574 repo = hg.repository(ui, path=path)
575 ui = repo.ui 575 ui = repo.ui
576 if not repo.local(): 576 if not repo.local():
577 raise util.Abort(_("repository '%s' is not local") % path) 577 raise util.Abort(_("repository '%s' is not local") % path)
578 ui.setconfig("bundle", "mainreporoot", repo.root) 578 ui.setconfig("bundle", "mainreporoot", repo.root)
579 except error.RequirementError:
580 raise
579 except error.RepoError: 581 except error.RepoError:
580 if cmd not in commands.optionalrepo.split(): 582 if cmd not in commands.optionalrepo.split():
581 if args and not path: # try to infer -R from command args 583 if args and not path: # try to infer -R from command args
582 repos = map(cmdutil.findrepo, args) 584 repos = map(cmdutil.findrepo, args)
583 guess = repos[0] 585 guess = repos[0]