comparison mercurial/localrepo.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 1e497df514e2
children 053c042118bc
comparison
equal deleted inserted replaced
13446:1e497df514e2 13447:931a72e00efa
73 requirements = set(self.opener("requires").read().splitlines()) 73 requirements = set(self.opener("requires").read().splitlines())
74 except IOError, inst: 74 except IOError, inst:
75 if inst.errno != errno.ENOENT: 75 if inst.errno != errno.ENOENT:
76 raise 76 raise
77 for r in requirements - self.supported: 77 for r in requirements - self.supported:
78 raise error.RepoError(_("requirement '%s' not supported") % r) 78 raise error.RequirementError(
79 _("requirement '%s' not supported") % r)
79 80
80 self.sharedpath = self.path 81 self.sharedpath = self.path
81 try: 82 try:
82 s = os.path.realpath(self.opener("sharedpath").read()) 83 s = os.path.realpath(self.opener("sharedpath").read())
83 if not os.path.exists(s): 84 if not os.path.exists(s):