##// END OF EJS Templates
delta: add sidedata field to revision delta...
Raphaël Gomès -
r47446:e8c11a2c default
parent child Browse files
Show More
@@ -288,6 +288,7 b' class sqliterevisiondelta(object):'
288 288 baserevisionsize = attr.ib()
289 289 revision = attr.ib()
290 290 delta = attr.ib()
291 sidedata = attr.ib()
291 292 linknode = attr.ib(default=None)
292 293
293 294
@@ -908,6 +909,10 b' class sqlitefilestore(object):'
908 909 def files(self):
909 910 return []
910 911
912 def sidedata(self, nodeorrev, _df=None):
913 # Not supported for now
914 return {}
915
911 916 def storageinfo(
912 917 self,
913 918 exclusivefiles=False,
@@ -618,6 +618,13 b' def _revisiondeltatochunks(delta, header'
618 618 yield prefix
619 619 yield data
620 620
621 sidedata = delta.sidedata
622 if sidedata is not None:
623 # Need a separate chunk for sidedata to be able to differentiate
624 # "raw delta" length and sidedata length
625 yield chunkheader(len(sidedata))
626 yield sidedata
627
621 628
622 629 def _sortnodesellipsis(store, nodes, cl, lookup):
623 630 """Sort nodes for changegroup generation."""
@@ -453,6 +453,10 b' class irevisiondelta(interfaceutil.Inter'
453 453 """
454 454 )
455 455
456 sidedata = interfaceutil.Attribute(
457 """Raw sidedata bytes for the given revision."""
458 )
459
456 460
457 461 class ifilerevisionssequence(interfaceutil.Interface):
458 462 """Contains index data for all revisions of a file.
@@ -204,6 +204,7 b' class revlogrevisiondelta(object):'
204 204 baserevisionsize = attr.ib()
205 205 revision = attr.ib()
206 206 delta = attr.ib()
207 sidedata = attr.ib()
207 208 linknode = attr.ib(default=None)
208 209
209 210
@@ -2587,6 +2588,7 b' class revlog(object):'
2587 2588 dfh,
2588 2589 alwayscache=alwayscache,
2589 2590 deltacomputer=deltacomputer,
2591 sidedata=sidedata,
2590 2592 )
2591 2593
2592 2594 if addrevisioncb:
@@ -1158,7 +1158,7 b' class ifilemutationtests(basetestcase):'
1158 1158 f = self._makefilefn()
1159 1159
1160 1160 deltas = [
1161 (node0, nullid, nullid, nullid, nullid, delta0, 0),
1161 (node0, nullid, nullid, nullid, nullid, delta0, 0, {}),
1162 1162 ]
1163 1163
1164 1164 with self._maketransactionfn() as tr:
@@ -1214,7 +1214,9 b' class ifilemutationtests(basetestcase):'
1214 1214 for i, fulltext in enumerate(fulltexts):
1215 1215 delta = mdiff.trivialdiffheader(len(fulltext)) + fulltext
1216 1216
1217 deltas.append((nodes[i], nullid, nullid, nullid, nullid, delta, 0))
1217 deltas.append(
1218 (nodes[i], nullid, nullid, nullid, nullid, delta, 0, {})
1219 )
1218 1220
1219 1221 with self._maketransactionfn() as tr:
1220 1222 newnodes = []
@@ -1262,7 +1264,9 b' class ifilemutationtests(basetestcase):'
1262 1264 )
1263 1265
1264 1266 delta = mdiff.textdiff(b'bar\n' * 30, (b'bar\n' * 30) + b'baz\n')
1265 deltas = [(b'\xcc' * 20, node1, nullid, b'\x01' * 20, node1, delta, 0)]
1267 deltas = [
1268 (b'\xcc' * 20, node1, nullid, b'\x01' * 20, node1, delta, 0, {})
1269 ]
1266 1270
1267 1271 with self._maketransactionfn() as tr:
1268 1272 with self.assertRaises(error.CensoredBaseError):
@@ -478,6 +478,7 b' def emitrevisions('
478 478 baserevisionsize=baserevisionsize,
479 479 revision=revision,
480 480 delta=delta,
481 sidedata=sidedata,
481 482 )
482 483
483 484 prevrev = rev
General Comments 0
You need to be logged in to leave comments. Login now