comparison mercurial/scmutil.py @ 17747:aad3bce98f76

store: invoke "osutil.listdir()" via vfs This patch invokes "osutil.listdir()" via vfs object. The function added newly to "abstractvfs" is named not as "listdir()" but as "readdir()", because: - "os.listdir()" seems to be more familiar as "listdir()" than "osutil.listdir()" - "osutil.listdir()" returns also type of each files like "readdir()" POSIX API: even though "d_type" field of "dirent" structure is defined mainly only on BSD/Linux This patch invokes "osutil.listdir()" via "rawvfs" object to avoid filename encoding, because the path passed to "osutil.listdir()" shouldn't be encoded. This patch also omits importing "osutil" module, because it is no longer used.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 09 Oct 2012 16:17:55 +0900
parents 7cb7e17c23b2
children 76b73ce0ffac
comparison
equal deleted inserted replaced
17746:6d218e47cf9b 17747:aad3bce98f76
216 def makedirs(self, path=None, mode=None): 216 def makedirs(self, path=None, mode=None):
217 return util.makedirs(self.join(path), mode) 217 return util.makedirs(self.join(path), mode)
218 218
219 def mkdir(self, path=None): 219 def mkdir(self, path=None):
220 return os.mkdir(self.join(path)) 220 return os.mkdir(self.join(path))
221
222 def readdir(self, path=None, stat=None, skip=None):
223 return osutil.listdir(self.join(path), stat, skip)
221 224
222 def stat(self, path=None): 225 def stat(self, path=None):
223 return os.stat(self.join(path)) 226 return os.stat(self.join(path))
224 227
225 class vfs(abstractvfs): 228 class vfs(abstractvfs):