Mercurial > hg-stable
changeset 51092:31f143448704
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 19 Oct 2023 01:50:07 +0200 |
parents | df50a1592e0c |
children | c2c24b6b97f5 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 )