# HG changeset patch # User FUJIWARA Katsunori # Date 1432051569 -32400 # Node ID fd0f919170d20f8328398de2cca3d8bef160534a # Parent 00d426a3813760ca1c65c0c0446b1221bba45a32 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. diff -r 00d426a38137 -r fd0f919170d2 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