##// END OF EJS Templates
sidedata: gate sidedata functionality to revlogv2 in more places...
Raphaël Gomès -
r47841:5554aacd default
parent child Browse files
Show More
@@ -293,7 +293,12 b' class cg1unpacker(object):'
293
293
294 # Only useful if we're adding sidedata categories. If both peers have
294 # Only useful if we're adding sidedata categories. If both peers have
295 # the same categories, then we simply don't do anything.
295 # the same categories, then we simply don't do anything.
296 if self.version == b'04' and srctype == b'pull':
296 adding_sidedata = (
297 requirements.REVLOGV2_REQUIREMENT in repo.requirements
298 and self.version == b'04'
299 and srctype == b'pull'
300 )
301 if adding_sidedata:
297 sidedata_helpers = get_sidedata_helpers(
302 sidedata_helpers = get_sidedata_helpers(
298 repo,
303 repo,
299 sidedata_categories or set(),
304 sidedata_categories or set(),
@@ -3365,6 +3365,9 b' class localrepository(object):'
3365 return self.pathto(fp.name[len(self.root) + 1 :])
3365 return self.pathto(fp.name[len(self.root) + 1 :])
3366
3366
3367 def register_wanted_sidedata(self, category):
3367 def register_wanted_sidedata(self, category):
3368 if requirementsmod.REVLOGV2_REQUIREMENT not in self.requirements:
3369 # Only revlogv2 repos can want sidedata.
3370 return
3368 self._wanted_sidedata.add(pycompat.bytestr(category))
3371 self._wanted_sidedata.add(pycompat.bytestr(category))
3369
3372
3370 def register_sidedata_computer(self, kind, category, keys, computer):
3373 def register_sidedata_computer(self, kind, category, keys, computer):
@@ -2246,7 +2246,7 b' class revlog(object):'
2246
2246
2247 deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
2247 deltainfo = deltacomputer.finddeltainfo(revinfo, fh)
2248
2248
2249 if sidedata:
2249 if sidedata and self.version & 0xFFFF == REVLOGV2:
2250 serialized_sidedata = sidedatautil.serialize_sidedata(sidedata)
2250 serialized_sidedata = sidedatautil.serialize_sidedata(sidedata)
2251 sidedata_offset = offset + deltainfo.deltalen
2251 sidedata_offset = offset + deltainfo.deltalen
2252 else:
2252 else:
General Comments 0
You need to be logged in to leave comments. Login now