##// END OF EJS Templates
revlog: generate trivial deltas against null revision...
Matt Mackall -
r5367:7530334b default
parent child Browse files
Show More
@@ -245,6 +245,9 b' def patch(a, bin):'
245 def get_matching_blocks(a, b):
245 def get_matching_blocks(a, b):
246 return [(d[0], d[2], d[1] - d[0]) for d in bdiff.blocks(a, b)]
246 return [(d[0], d[2], d[1] - d[0]) for d in bdiff.blocks(a, b)]
247
247
248 def trivialdiffheader(length):
249 return struct.pack(">lll", 0, 0, length)
250
248 patches = mpatch.patches
251 patches = mpatch.patches
249 patchedsize = mpatch.patchedsize
252 patchedsize = mpatch.patchedsize
250 textdiff = bdiff.bdiff
253 textdiff = bdiff.bdiff
@@ -1087,9 +1087,13 b' class revlog(object):'
1087 if infocollect is not None:
1087 if infocollect is not None:
1088 infocollect(nb)
1088 infocollect(nb)
1089
1089
1090 d = self.revdiff(a, b)
1091 p = self.parents(nb)
1090 p = self.parents(nb)
1092 meta = nb + p[0] + p[1] + lookup(nb)
1091 meta = nb + p[0] + p[1] + lookup(nb)
1092 if a == -1:
1093 d = self.revision(nb)
1094 meta += mdiff.trivialdiffheader(len(d))
1095 else:
1096 d = self.revdiff(a, b)
1093 yield changegroup.genchunk("%s%s" % (meta, d))
1097 yield changegroup.genchunk("%s%s" % (meta, d))
1094
1098
1095 yield changegroup.closechunk()
1099 yield changegroup.closechunk()
General Comments 0
You need to be logged in to leave comments. Login now