# HG changeset patch # User FUJIWARA Katsunori # Date 2015-05-19 16:06:09 # 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 --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -326,7 +326,11 @@ class dirstate(object): 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