Mercurial > hg
comparison mercurial/dirstate.py @ 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 | 3c346969c321 |
comparison
equal
deleted
inserted
replaced
25226:00d426a38137 | 25227:fd0f919170d2 |
---|---|
324 | 324 |
325 def _read(self): | 325 def _read(self): |
326 self._map = {} | 326 self._map = {} |
327 self._copymap = {} | 327 self._copymap = {} |
328 try: | 328 try: |
329 st = self._opener.read(self._filename) | 329 fp = self._opener.open(self._filename) |
330 try: | |
331 st = fp.read() | |
332 finally: | |
333 fp.close() | |
330 except IOError, err: | 334 except IOError, err: |
331 if err.errno != errno.ENOENT: | 335 if err.errno != errno.ENOENT: |
332 raise | 336 raise |
333 return | 337 return |
334 if not st: | 338 if not st: |