Show More
@@ -117,15 +117,23 b' class manifest(revlog.revlog):' | |||||
117 | # apply the changes collected during the bisect loop to our addlist |
|
117 | # apply the changes collected during the bisect loop to our addlist | |
118 | # return a delta suitable for addrevision |
|
118 | # return a delta suitable for addrevision | |
119 | def addlistdelta(addlist, x): |
|
119 | def addlistdelta(addlist, x): | |
120 | # start from the bottom up |
|
120 | # for large addlist arrays, building a new array is cheaper | |
121 | # so changes to the offsets don't mess things up. |
|
121 | # than repeatedly modifying the existing one | |
122 | for start, end, content in reversed(x): |
|
122 | currentposition = 0 | |
|
123 | newaddlist = array.array('c') | |||
|
124 | ||||
|
125 | for start, end, content in x: | |||
|
126 | newaddlist += addlist[currentposition:start] | |||
123 | if content: |
|
127 | if content: | |
124 |
addlist |
|
128 | newaddlist += array.array('c', content) | |
125 | else: |
|
129 | ||
126 | del addlist[start:end] |
|
130 | currentposition = end | |
127 | return "".join(struct.pack(">lll", start, end, len(content)) |
|
131 | ||
|
132 | newaddlist += addlist[currentposition:] | |||
|
133 | ||||
|
134 | deltatext = "".join(struct.pack(">lll", start, end, len(content)) | |||
128 | + content for start, end, content in x) |
|
135 | + content for start, end, content in x) | |
|
136 | return deltatext, newaddlist | |||
129 |
|
137 | |||
130 | def checkforbidden(l): |
|
138 | def checkforbidden(l): | |
131 | for f in l: |
|
139 | for f in l: | |
@@ -194,7 +202,8 b' class manifest(revlog.revlog):' | |||||
194 | if dstart is not None: |
|
202 | if dstart is not None: | |
195 | delta.append([dstart, dend, "".join(dline)]) |
|
203 | delta.append([dstart, dend, "".join(dline)]) | |
196 | # apply the delta to the addlist, and get a delta for addrevision |
|
204 | # apply the delta to the addlist, and get a delta for addrevision | |
197 |
|
|
205 | deltatext, addlist = addlistdelta(addlist, delta) | |
|
206 | cachedelta = (self.rev(p1), deltatext) | |||
198 | arraytext = addlist |
|
207 | arraytext = addlist | |
199 | text = util.buffer(arraytext) |
|
208 | text = util.buffer(arraytext) | |
200 |
|
209 |
General Comments 0
You need to be logged in to leave comments.
Login now