Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 17157:87e8440964a0
localrepo: use path expansion API via vfs
As a part of migration to vfs, this patch moves path expansion API
invocations in the constructor of "localrepository" to the constructor
of "opener", because the root path to the repository is very important
to handle paths using non-ASCII characters correctly.
This patch also rearrange initialization order of "wvfs" field,
because it is required to initialize "self.root".
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 06 Jul 2012 18:45:27 +0900 |
parents | 7034365089bf |
children | 60338880d265 |
comparison
equal
deleted
inserted
replaced
17156:7034365089bf | 17157:87e8440964a0 |
---|---|
35 def _baserequirements(self, create): | 35 def _baserequirements(self, create): |
36 return self.requirements[:] | 36 return self.requirements[:] |
37 | 37 |
38 def __init__(self, baseui, path=None, create=False): | 38 def __init__(self, baseui, path=None, create=False): |
39 repo.repository.__init__(self) | 39 repo.repository.__init__(self) |
40 self.root = os.path.realpath(util.expandpath(path)) | 40 self.wopener = scmutil.opener(path, expand=True) |
41 self.wvfs = self.wopener | |
42 self.root = self.wvfs.base | |
41 self.path = os.path.join(self.root, ".hg") | 43 self.path = os.path.join(self.root, ".hg") |
42 self.origroot = path | 44 self.origroot = path |
43 self.auditor = scmutil.pathauditor(self.root, self._checknested) | 45 self.auditor = scmutil.pathauditor(self.root, self._checknested) |
44 self.opener = scmutil.opener(self.path) | 46 self.opener = scmutil.opener(self.path) |
45 self.vfs = self.opener | 47 self.vfs = self.opener |
46 self.wopener = scmutil.opener(self.root) | |
47 self.wvfs = self.wopener | |
48 self.baseui = baseui | 48 self.baseui = baseui |
49 self.ui = baseui.copy() | 49 self.ui = baseui.copy() |
50 # A list of callback to shape the phase if no data were found. | 50 # A list of callback to shape the phase if no data were found. |
51 # Callback are in the form: func(repo, roots) --> processed root. | 51 # Callback are in the form: func(repo, roots) --> processed root. |
52 # This list it to be filled by extension during repo setup | 52 # This list it to be filled by extension during repo setup |