equal
deleted
inserted
replaced
265 % (self.datafile, rev)) |
265 % (self.datafile, rev)) |
266 |
266 |
267 self.cache = (node, rev, text) |
267 self.cache = (node, rev, text) |
268 return text |
268 return text |
269 |
269 |
270 def addrevision(self, text, transaction, link, p1=None, p2=None): |
270 def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): |
271 if text is None: text = "" |
271 if text is None: text = "" |
272 if p1 is None: p1 = self.tip() |
272 if p1 is None: p1 = self.tip() |
273 if p2 is None: p2 = nullid |
273 if p2 is None: p2 = nullid |
274 |
274 |
275 node = hash(text, p1, p2) |
275 node = hash(text, p1, p2) |
282 |
282 |
283 if n: |
283 if n: |
284 base = self.base(t) |
284 base = self.base(t) |
285 start = self.start(base) |
285 start = self.start(base) |
286 end = self.end(t) |
286 end = self.end(t) |
287 prev = self.revision(self.tip()) |
287 if not d: |
288 d = self.diff(prev, text) |
288 prev = self.revision(self.tip()) |
|
289 d = self.diff(prev, text) |
289 data = compress(d) |
290 data = compress(d) |
290 dist = end - start + len(data) |
291 dist = end - start + len(data) |
291 |
292 |
292 # full versions are inserted when the needed deltas |
293 # full versions are inserted when the needed deltas |
293 # become comparable to the uncompressed text |
294 # become comparable to the uncompressed text |