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.
--- 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: