Mercurial > hg > mercurial-source
changeset 36756:69cf2e422490
revlog: use context manager for data file lifetime in checkinlinesize
This is clearer, safer and more modern.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 05 Feb 2018 17:34:47 +0100 |
parents | 1f2b8a644dd4 |
children | 0f2c51afafb2 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1859,12 +1859,9 @@ fp.flush() fp.close() - df = self._datafp('w') - try: + with self._datafp('w') as df: for r in self: df.write(self._getsegmentforrevs(r, r)[1]) - finally: - df.close() fp = self._indexfp('w') self.version &= ~FLAG_INLINE_DATA