D10025: revlogv2: don't assume that the sidedata of the last rev is right after data
Alphare (Raphaël Gomès)
phabricator at mercurial-scm.org
Fri Feb 19 11:16:23 UTC 2021
Alphare created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
We are going to be rewriting sidedata soon, it's going to be appended to the
revlog data file, meaning that the data and the sidedata might not be
contiguous.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10025
AFFECTED FILES
mercurial/revlog.py
CHANGE DETAILS
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -2337,7 +2337,15 @@
curr = len(self)
prev = curr - 1
- offset = self.end(prev)
+ if self.version & 0xFFFF == REVLOGV2:
+ prev_node = self.index[prev]
+ sidedata_offset = prev_node[10]
+ if sidedata_offset == 0:
+ offset = self.end(prev)
+ else:
+ offset = sidedata_offset + prev_node[11]
+ else:
+ offset = self.end(prev)
p1r, p2r = self.rev(p1), self.rev(p2)
# full versions are inserted when the needed deltas
To: Alphare, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list