Mercurial > hg
comparison mercurial/localrepo.py @ 15355:dbdb777502dc stable
consistency: use util.realpath instead of os.path.realpath where useful
exceptions:
hg: os.path.realpath used before util can be imported
tests/run-tests.py: may not import mercurial modules
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Mon, 24 Oct 2011 13:51:24 +0200 |
parents | c681e478c429 |
children | c519cd8f0169 |
comparison
equal
deleted
inserted
replaced
15354:42630f54e513 | 15355:dbdb777502dc |
---|---|
26 supported = supportedformats | set(('store', 'fncache', 'shared', | 26 supported = supportedformats | set(('store', 'fncache', 'shared', |
27 'dotencode')) | 27 'dotencode')) |
28 | 28 |
29 def __init__(self, baseui, path=None, create=False): | 29 def __init__(self, baseui, path=None, create=False): |
30 repo.repository.__init__(self) | 30 repo.repository.__init__(self) |
31 self.root = os.path.realpath(util.expandpath(path)) | 31 self.root = util.realpath(util.expandpath(path)) |
32 self.path = os.path.join(self.root, ".hg") | 32 self.path = os.path.join(self.root, ".hg") |
33 self.origroot = path | 33 self.origroot = path |
34 self.auditor = scmutil.pathauditor(self.root, self._checknested) | 34 self.auditor = scmutil.pathauditor(self.root, self._checknested) |
35 self.opener = scmutil.opener(self.path) | 35 self.opener = scmutil.opener(self.path) |
36 self.wopener = scmutil.opener(self.root) | 36 self.wopener = scmutil.opener(self.root) |
77 raise | 77 raise |
78 requirements = set() | 78 requirements = set() |
79 | 79 |
80 self.sharedpath = self.path | 80 self.sharedpath = self.path |
81 try: | 81 try: |
82 s = os.path.realpath(self.opener.read("sharedpath").rstrip('\n')) | 82 s = util.realpath(self.opener.read("sharedpath").rstrip('\n')) |
83 if not os.path.exists(s): | 83 if not os.path.exists(s): |
84 raise error.RepoError( | 84 raise error.RepoError( |
85 _('.hg/sharedpath points to nonexistent directory %s') % s) | 85 _('.hg/sharedpath points to nonexistent directory %s') % s) |
86 self.sharedpath = s | 86 self.sharedpath = s |
87 except IOError, inst: | 87 except IOError, inst: |