Show More
@@ -300,18 +300,19 b' nomem:' | |||||
300 |
|
300 | |||
301 | static PyObject *bdiff(PyObject *self, PyObject *args) |
|
301 | static PyObject *bdiff(PyObject *self, PyObject *args) | |
302 | { |
|
302 | { | |
303 | PyObject *sa, *sb, *result = NULL; |
|
303 | char *sa, *sb; | |
|
304 | PyObject *result = NULL; | |||
304 | struct line *al, *bl; |
|
305 | struct line *al, *bl; | |
305 | struct hunklist l = {NULL, NULL}; |
|
306 | struct hunklist l = {NULL, NULL}; | |
306 | struct hunk *h; |
|
307 | struct hunk *h; | |
307 | char encode[12], *rb; |
|
308 | char encode[12], *rb; | |
308 |
int an, bn, len = 0, la |
|
309 | int an, bn, len = 0, la, lb; | |
309 |
|
310 | |||
310 |
if (!PyArg_ParseTuple(args, " |
|
311 | if (!PyArg_ParseTuple(args, "t#t#:bdiff", &sa, &la, &sb, &lb)) | |
311 | return NULL; |
|
312 | return NULL; | |
312 |
|
313 | |||
313 |
an = splitlines( |
|
314 | an = splitlines(sa, la, &al); | |
314 |
bn = splitlines( |
|
315 | bn = splitlines(sb, lb, &bl); | |
315 | if (!al || !bl) |
|
316 | if (!al || !bl) | |
316 | goto nomem; |
|
317 | goto nomem; | |
317 |
|
318 | |||
@@ -320,6 +321,7 b' static PyObject *bdiff(PyObject *self, P' | |||||
320 | goto nomem; |
|
321 | goto nomem; | |
321 |
|
322 | |||
322 | /* calculate length of output */ |
|
323 | /* calculate length of output */ | |
|
324 | la = lb = 0; | |||
323 | for (h = l.base; h != l.head; h++) { |
|
325 | for (h = l.base; h != l.head; h++) { | |
324 | if (h->a1 != la || h->b1 != lb) |
|
326 | if (h->a1 != la || h->b1 != lb) | |
325 | len += 12 + bl[h->b1].l - bl[lb].l; |
|
327 | len += 12 + bl[h->b1].l - bl[lb].l; |
@@ -973,7 +973,7 b' class revlog(object):' | |||||
973 | end = self.end(t) |
|
973 | end = self.end(t) | |
974 | if not d: |
|
974 | if not d: | |
975 | prev = self.revision(self.tip()) |
|
975 | prev = self.revision(self.tip()) | |
976 |
d = self.diff(prev, |
|
976 | d = self.diff(prev, text) | |
977 | data = compress(d) |
|
977 | data = compress(d) | |
978 | l = len(data[1]) + len(data[0]) |
|
978 | l = len(data[1]) + len(data[0]) | |
979 | dist = end - start + l |
|
979 | dist = end - start + l |
General Comments 0
You need to be logged in to leave comments.
Login now