diff 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
line wrap: on
line diff
--- a/mercurial/scmutil.py	Tue Oct 15 00:51:04 2013 +0900
+++ b/mercurial/scmutil.py	Tue Oct 15 00:51:04 2013 +0900
@@ -245,6 +245,9 @@
     def exists(self, path=None):
         return os.path.exists(self.join(path))
 
+    def fstat(self, fp):
+        return util.fstat(fp)
+
     def isdir(self, path=None):
         return os.path.isdir(self.join(path))