Skip to content
Snippets Groups Projects
Commit b6205c7b authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

revlog: replace REVLOGV2 check related to sidedata with `hassidedata` checks

This is more flexible and semantically more correct. The associated revlog's
attribute exist since 827cb4fe62a3, so well we start linking sidedata to
revlogv2.

Differential Revision: https://phab.mercurial-scm.org/D10562
parent f43c0121
No related branches found
No related tags found
No related merge requests found
......@@ -715,7 +715,7 @@
return self.index[rev][1]
def sidedata_length(self, rev):
if self.version & 0xFFFF != REVLOGV2:
if not self.hassidedata:
return 0
return self.index[rev][9]
......@@ -1771,7 +1771,7 @@
# revision or might need to be processed to retrieve the revision.
rev, rawtext, validated = self._rawtext(node, rev, _df=_df)
if self.version & 0xFFFF == REVLOGV2:
if self.hassidedata:
if rev is None:
rev = self.rev(node)
sidedata = self._sidedata(rev)
......@@ -2246,7 +2246,7 @@
deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
if sidedata and self.version & 0xFFFF == REVLOGV2:
if sidedata and self.hassidedata:
serialized_sidedata = sidedatautil.serialize_sidedata(sidedata)
sidedata_offset = offset + deltainfo.deltalen
else:
......@@ -3072,7 +3072,7 @@
return d
def rewrite_sidedata(self, helpers, startrev, endrev):
if self.version & 0xFFFF != REVLOGV2:
if not self.hassidedata:
return
# inline are not yet supported because they suffer from an issue when
# rewriting them (since it's not an append-only operation).
......
......@@ -42,7 +42,7 @@
text, sd = orig(self, nodeorrev, *args, **kwargs)
if getattr(self, 'sidedatanocheck', False):
return text, sd
if self.version & 0xFFFF != 2:
if self.hassidedata:
return text, sd
if nodeorrev != nullrev and nodeorrev != self.nullid:
cat1 = sd.get(sidedata.SD_TEST1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment