vfs: add "open()" for newly added code paths which open files via vfs
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Tue, 15 Oct 2013 00:51:04 +0900
changeset 19897 896a4568def7
parent 19896 af03279c766a
child 19898 3f92e749d381
vfs: add "open()" for newly added code paths which open files via vfs This patch replaces "open()" by own "__call__()" defined in derived classes at the first invocation, for efficiency of succeeding invocations.
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue Oct 15 00:51:04 2013 +0900
+++ b/mercurial/scmutil.py	Tue Oct 15 00:51:04 2013 +0900
@@ -217,6 +217,10 @@
                 raise
         return ""
 
+    def open(self, path, mode="r", text=False, atomictemp=False):
+        self.open = self.__call__
+        return self.__call__(path, mode, text, atomictemp)
+
     def read(self, path):
         fp = self(path, 'rb')
         try: