##// END OF EJS Templates
localrepo: use file API via vfs while ensuring repository directory...
FUJIWARA Katsunori -
r17161:be016e96 default
parent child Browse files
Show More
@@ -58,14 +58,14 b' class localrepository(repo.repository):'
58 58 except IOError:
59 59 pass
60 60
61 if not os.path.isdir(self.path):
61 if not self.vfs.isdir():
62 62 if create:
63 if not os.path.exists(self.root):
64 util.makedirs(self.root)
65 util.makedir(self.path, notindexed=True)
63 if not self.wvfs.exists():
64 self.wvfs.makedirs()
65 self.vfs.makedir(notindexed=True)
66 66 requirements = self._baserequirements(create)
67 67 if self.ui.configbool('format', 'usestore', True):
68 os.mkdir(os.path.join(self.path, "store"))
68 self.vfs.mkdir("store")
69 69 requirements.append("store")
70 70 if self.ui.configbool('format', 'usefncache', True):
71 71 requirements.append("fncache")
@@ -190,6 +190,21 b' class abstractopener(object):'
190 190 finally:
191 191 fp.close()
192 192
193 def mkdir(self, path=None):
194 return os.mkdir(self.join(path))
195
196 def exists(self, path=None):
197 return os.path.exists(self.join(path))
198
199 def isdir(self, path=None):
200 return os.path.isdir(self.join(path))
201
202 def makedir(self, path=None, notindexed=True):
203 return util.makedir(self.join(path), notindexed)
204
205 def makedirs(self, path=None, mode=None):
206 return util.makedirs(self.join(path), mode)
207
193 208 class opener(abstractopener):
194 209 '''Open files relative to a base directory
195 210
@@ -293,7 +308,10 b' class opener(abstractopener):'
293 308 self.auditor(path)
294 309
295 310 def join(self, path):
296 return os.path.join(self.base, path)
311 if path:
312 return os.path.join(self.base, path)
313 else:
314 return self.base
297 315
298 316 class filteropener(abstractopener):
299 317 '''Wrapper opener for filtering filenames with a function.'''
General Comments 0
You need to be logged in to leave comments. Login now