revlog: drop reference to docket in the inline-splitting code
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 19 Oct 2023 01:50:07 +0200
changeset 51088 31f143448704
parent 51087 df50a1592e0c
child 51089 c2c24b6b97f5
revlog: drop reference to docket in the inline-splitting code revlog with a docket do not use inline revlog and do not need to split them. So we can remove some code handling docket there.
mercurial/revlog.py
--- a/mercurial/revlog.py	Tue Oct 24 17:03:27 2023 +0200
+++ b/mercurial/revlog.py	Thu Oct 19 01:50:07 2023 +0200
@@ -2563,6 +2563,10 @@
         if not self._inline or total_size < _maxinline:
             return
 
+        if self._docket is not None:
+            msg = b"inline revlog should not have a docket"
+            raise error.ProgrammingError(msg)
+
         troffset = tr.findoffset(self._indexfile)
         if troffset is None:
             raise error.RevlogError(
@@ -2634,13 +2638,11 @@
                 self._inner.inline = False
                 for i in self:
                     e = self.index.entry_binary(i)
-                    if i == 0 and self._docket is None:
+                    if i == 0:
                         header = self._format_flags | self._format_version
                         header = self.index.pack_header(header)
                         e = header + e
                     fp.write(e)
-                if self._docket is not None:
-                    self._docket.index_end = fp.tell()
 
                 # If we don't use side-write, the temp file replace the real
                 # index when we exit the context manager
@@ -2655,8 +2657,6 @@
             if existing_handles:
                 # switched from inline to conventional reopen the index
                 index_end = None
-                if self._docket is not None:
-                    index_end = self._docket.index_end
                 ifh = self._inner._InnerRevlog__index_write_fp(
                     index_end=index_end
                 )