comparison mercurial/scmutil.py @ 19899:8c3dcbbfb5de

changelog: use "vfs.fstat()" instead of "util.fstat()" Just invoking "os.fstat()" with "file.fileno()" doesn't require non ANSI file API, because filename is not used for invocation of "os.fstat()". But "util.fstat()" should invoke "os.stat()" with "fp.name", if file object doesn't have "fileno()" method for portability, and "fp.name" may cause invocation of non ANSI file API. So, this patch makes the constructor of appender class invoke "util.fstat()" via vfs, to encapsulate filename handling.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 15 Oct 2013 00:51:04 +0900
parents 896a4568def7
children 7c21e3398931
comparison
equal deleted inserted replaced
19898:3f92e749d381 19899:8c3dcbbfb5de
242 finally: 242 finally:
243 fp.close() 243 fp.close()
244 244
245 def exists(self, path=None): 245 def exists(self, path=None):
246 return os.path.exists(self.join(path)) 246 return os.path.exists(self.join(path))
247
248 def fstat(self, fp):
249 return util.fstat(fp)
247 250
248 def isdir(self, path=None): 251 def isdir(self, path=None):
249 return os.path.isdir(self.join(path)) 252 return os.path.isdir(self.join(path))
250 253
251 def islink(self, path=None): 254 def islink(self, path=None):