# HG changeset patch # User Pierre-Yves David # Date 2023-09-26 00:49:18 # 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 --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2228,9 +2228,9 @@ class revlog: 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: