Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 17161:be016e96117a
localrepo: use file API via vfs while ensuring repository directory
As a part of migration to vfs, this patch invokes some file API
indirectly via vfs, while ensuring repository directory in the
constructor of "localrepository" class.
New file API are added to "scmutil.abstractopener" class, because they
are also used via other derived classes than "scmutil.opener".
But "join()" is not yet defined other than "scmutil.opener" class,
because it should not be used via other opener classes yet.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 06 Jul 2012 18:45:27 +0900 |
parents | 22b9b1d2f5d4 |
children | c18ecebed3f1 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Fri Jul 06 18:45:27 2012 +0900 +++ b/mercurial/localrepo.py Fri Jul 06 18:45:27 2012 +0900 @@ -58,14 +58,14 @@ except IOError: pass - if not os.path.isdir(self.path): + if not self.vfs.isdir(): if create: - if not os.path.exists(self.root): - util.makedirs(self.root) - util.makedir(self.path, notindexed=True) + if not self.wvfs.exists(): + self.wvfs.makedirs() + self.vfs.makedir(notindexed=True) requirements = self._baserequirements(create) if self.ui.configbool('format', 'usestore', True): - os.mkdir(os.path.join(self.path, "store")) + self.vfs.mkdir("store") requirements.append("store") if self.ui.configbool('format', 'usefncache', True): requirements.append("fncache")