Show More
@@ -218,7 +218,7 b' class revlog(object):' | |||||
218 | self.datafile = indexfile[:-2] + ".d" |
|
218 | self.datafile = indexfile[:-2] + ".d" | |
219 | self.opener = opener |
|
219 | self.opener = opener | |
220 | self._cache = None |
|
220 | self._cache = None | |
221 |
self._basecache = |
|
221 | self._basecache = (0, 0) | |
222 | self._chunkcache = (0, '') |
|
222 | self._chunkcache = (0, '') | |
223 | self.index = [] |
|
223 | self.index = [] | |
224 | self._pcache = {} |
|
224 | self._pcache = {} | |
@@ -1010,8 +1010,7 b' class revlog(object):' | |||||
1010 | delta = mdiff.textdiff(ptext, t) |
|
1010 | delta = mdiff.textdiff(ptext, t) | |
1011 | data = compress(delta) |
|
1011 | data = compress(delta) | |
1012 | l = len(data[1]) + len(data[0]) |
|
1012 | l = len(data[1]) + len(data[0]) | |
1013 |
basecache = |
|
1013 | if basecache[0] == rev: | |
1014 | if basecache and basecache[0] == rev: |
|
|||
1015 | chainbase = basecache[1] |
|
1014 | chainbase = basecache[1] | |
1016 | else: |
|
1015 | else: | |
1017 | chainbase = self.chainbase(rev) |
|
1016 | chainbase = self.chainbase(rev) | |
@@ -1020,14 +1019,15 b' class revlog(object):' | |||||
1020 | base = rev |
|
1019 | base = rev | |
1021 | else: |
|
1020 | else: | |
1022 | base = chainbase |
|
1021 | base = chainbase | |
1023 | return dist, l, data, base |
|
1022 | return dist, l, data, base, chainbase | |
1024 |
|
1023 | |||
1025 | curr = len(self) |
|
1024 | curr = len(self) | |
1026 | prev = curr - 1 |
|
1025 | prev = curr - 1 | |
1027 | base = curr |
|
1026 | base = chainbase = curr | |
1028 | offset = self.end(prev) |
|
1027 | offset = self.end(prev) | |
1029 | flags = 0 |
|
1028 | flags = 0 | |
1030 | d = None |
|
1029 | d = None | |
|
1030 | basecache = self._basecache | |||
1031 | p1r, p2r = self.rev(p1), self.rev(p2) |
|
1031 | p1r, p2r = self.rev(p1), self.rev(p2) | |
1032 |
|
1032 | |||
1033 | # should we try to build a delta? |
|
1033 | # should we try to build a delta? | |
@@ -1036,7 +1036,7 b' class revlog(object):' | |||||
1036 | d = builddelta(p1r) |
|
1036 | d = builddelta(p1r) | |
1037 | else: |
|
1037 | else: | |
1038 | d = builddelta(prev) |
|
1038 | d = builddelta(prev) | |
1039 | dist, l, data, base = d |
|
1039 | dist, l, data, base, chainbase = d | |
1040 |
|
1040 | |||
1041 | # full versions are inserted when the needed deltas |
|
1041 | # full versions are inserted when the needed deltas | |
1042 | # become comparable to the uncompressed text |
|
1042 | # become comparable to the uncompressed text | |
@@ -1049,7 +1049,7 b' class revlog(object):' | |||||
1049 | text = buildtext() |
|
1049 | text = buildtext() | |
1050 | data = compress(text) |
|
1050 | data = compress(text) | |
1051 | l = len(data[1]) + len(data[0]) |
|
1051 | l = len(data[1]) + len(data[0]) | |
1052 | base = curr |
|
1052 | base = chainbase = curr | |
1053 |
|
1053 | |||
1054 | e = (offset_type(offset, flags), l, textlen, |
|
1054 | e = (offset_type(offset, flags), l, textlen, | |
1055 | base, link, p1r, p2r, node) |
|
1055 | base, link, p1r, p2r, node) | |
@@ -1075,7 +1075,7 b' class revlog(object):' | |||||
1075 |
|
1075 | |||
1076 | if type(text) == str: # only accept immutable objects |
|
1076 | if type(text) == str: # only accept immutable objects | |
1077 | self._cache = (node, curr, text) |
|
1077 | self._cache = (node, curr, text) | |
1078 | self._basecache = (curr, base) |
|
1078 | self._basecache = (curr, chainbase) | |
1079 | return node |
|
1079 | return node | |
1080 |
|
1080 | |||
1081 | def group(self, nodelist, bundler): |
|
1081 | def group(self, nodelist, bundler): |
General Comments 0
You need to be logged in to leave comments.
Login now