# HG changeset patch # User Pierre-Yves David # Date 1695689358 -7200 # Node ID 9011c38b4f65294d06844e0c01eba8bdcf0e9dde # Parent 299b7b5440db81088d8da07ac164a031b38b676d 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. diff -r 299b7b5440db -r 9011c38b4f65 mercurial/revlog.py --- 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: