Mercurial > hg
changeset 51025:9011c38b4f65
revlog: use a `reading` context in `_enforceinlinesize`
We are about to enforce reading context on various operation, so we make sure
top level method are in the right context.
In the future we might move the responsibility of opening the revlog for reading
higher in the call chain but lets limit the disruption for now.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 26 Sep 2023 02:49:18 +0200 |
parents | 299b7b5440db |
children | 8520db304f01 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Tue Sep 26 00:55:49 2023 +0200 +++ b/mercurial/revlog.py Tue Sep 26 02:49:18 2023 +0200 @@ -2228,9 +2228,9 @@ new_dfh = self._datafp(b'w+') new_dfh.truncate(0) # drop any potentially existing data try: - with self._indexfp() as read_ifh: + with self.reading(): for r in self: - new_dfh.write(self._getsegmentforrevs(r, r, df=read_ifh)[1]) + new_dfh.write(self._getsegmentforrevs(r, r)[1]) new_dfh.flush() if side_write: