Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 14482:58b36e9ea783
introduce new function scmutil.readrequires
for reading and parsing the .hg/requires file
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Tue, 31 May 2011 19:16:18 +0200 |
parents | cc8c09855d19 |
children | 1ffeeb91c55d |
comparison
equal
deleted
inserted
replaced
14481:b2ee161328e0 | 14482:58b36e9ea783 |
---|---|
66 else: | 66 else: |
67 raise error.RepoError(_("repository %s not found") % path) | 67 raise error.RepoError(_("repository %s not found") % path) |
68 elif create: | 68 elif create: |
69 raise error.RepoError(_("repository %s already exists") % path) | 69 raise error.RepoError(_("repository %s already exists") % path) |
70 else: | 70 else: |
71 # find requirements | |
72 requirements = set() | |
73 try: | 71 try: |
74 requirements = set(self.opener.read("requires").splitlines()) | 72 requirements = scmutil.readrequires(self.opener, self.supported) |
75 except IOError, inst: | 73 except IOError, inst: |
76 if inst.errno != errno.ENOENT: | 74 if inst.errno != errno.ENOENT: |
77 raise | 75 raise |
78 for r in requirements - self.supported: | 76 requirements = set() |
79 raise error.RequirementError( | |
80 _("requirement '%s' not supported") % r) | |
81 | 77 |
82 self.sharedpath = self.path | 78 self.sharedpath = self.path |
83 try: | 79 try: |
84 s = os.path.realpath(self.opener.read("sharedpath")) | 80 s = os.path.realpath(self.opener.read("sharedpath")) |
85 if not os.path.exists(s): | 81 if not os.path.exists(s): |