# HG changeset patch # User FUJIWARA Katsunori # Date 1381765864 -32400 # Node ID 896a4568def7e8ac61660cf72ca92235fbcef4a6 # Parent af03279c766a4c3d21129d466271ca12085f6b97 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. diff -r af03279c766a -r 896a4568def7 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: