dirstate: use open/read of vfs(opener) explicitly instead of read
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 20 May 2015 01:06:09 +0900
changeset 25227 fd0f919170d2
parent 25226 00d426a38137
child 25228 63a57a2727b6
dirstate: use open/read of vfs(opener) explicitly instead of read This simplifies changes in subsequent patch, which tries to open `.pending` file when HG_PENDING environment variable is defined.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed May 20 01:06:09 2015 +0900
+++ b/mercurial/dirstate.py	Wed May 20 01:06:09 2015 +0900
@@ -326,7 +326,11 @@
         self._map = {}
         self._copymap = {}
         try:
-            st = self._opener.read(self._filename)
+            fp = self._opener.open(self._filename)
+            try:
+                st = fp.read()
+            finally:
+                fp.close()
         except IOError, err:
             if err.errno != errno.ENOENT:
                 raise