Mercurial > hg-stable
changeset 25227:fd0f919170d2
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.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 20 May 2015 01:06:09 +0900 |
parents | 00d426a38137 |
children | 63a57a2727b6 |
files | mercurial/dirstate.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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