Mercurial > hg
comparison mercurial/scmutil.py @ 17723:ab23768746fd
scmutil: reorder newly added functions for vfs support in dictionary order
Definition functions for vfs support in dictionary order increases
readability/maintainability, because there are functions which invoke
file API:
- with same name: "os.listdir" and "osutil.listdir", for example
- with ambiguous names: "os.mkdir" and "util.makedirs", for example
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Tue, 09 Oct 2012 01:41:55 +0900 |
parents | a41fd730f230 |
children | ffd589d4b785 |
comparison
equal
deleted
inserted
replaced
17722:3b976051034d | 17723:ab23768746fd |
---|---|
202 try: | 202 try: |
203 return fp.write(data) | 203 return fp.write(data) |
204 finally: | 204 finally: |
205 fp.close() | 205 fp.close() |
206 | 206 |
207 def exists(self, path=None): | |
208 return os.path.exists(self.join(path)) | |
209 | |
210 def isdir(self, path=None): | |
211 return os.path.isdir(self.join(path)) | |
212 | |
213 def makedir(self, path=None, notindexed=True): | |
214 return util.makedir(self.join(path), notindexed) | |
215 | |
216 def makedirs(self, path=None, mode=None): | |
217 return util.makedirs(self.join(path), mode) | |
218 | |
207 def mkdir(self, path=None): | 219 def mkdir(self, path=None): |
208 return os.mkdir(self.join(path)) | 220 return os.mkdir(self.join(path)) |
209 | |
210 def exists(self, path=None): | |
211 return os.path.exists(self.join(path)) | |
212 | |
213 def isdir(self, path=None): | |
214 return os.path.isdir(self.join(path)) | |
215 | |
216 def makedir(self, path=None, notindexed=True): | |
217 return util.makedir(self.join(path), notindexed) | |
218 | |
219 def makedirs(self, path=None, mode=None): | |
220 return util.makedirs(self.join(path), mode) | |
221 | 221 |
222 class vfs(abstractvfs): | 222 class vfs(abstractvfs): |
223 '''Operate files relative to a base directory | 223 '''Operate files relative to a base directory |
224 | 224 |
225 This class is used to hide the details of COW semantics and | 225 This class is used to hide the details of COW semantics and |