diff -r 616b8f412676 -r 6b1eae313b2f mercurial/revlog.py --- a/mercurial/revlog.py Mon May 03 12:34:11 2021 +0200 +++ b/mercurial/revlog.py Mon May 03 12:34:21 2021 +0200 @@ -2017,7 +2017,7 @@ self._inline = False for i in self: e = self.index.entry_binary(i) - if i == 0: + if i == 0 and self._docket is None: header = self._format_flags | self._format_version header = self.index.pack_header(header) e = header + e @@ -2380,7 +2380,7 @@ self.index.append(e) entry = self.index.entry_binary(curr) - if curr == 0: + if curr == 0 and self._docket is None: header = self._format_flags | self._format_version header = self.index.pack_header(header) entry = header + entry @@ -3207,7 +3207,7 @@ rev = startrev + i self.index.replace_sidedata_info(rev, e[8], e[9], e[0]) packed = self.index.entry_binary(rev) - if rev == 0: + if rev == 0 and self._docket is None: header = self._format_flags | self._format_version header = self.index.pack_header(header) packed = header + packed