Show More
@@ -137,12 +137,15 b' class manifest(revlog.revlog):' | |||||
137 | arraytext = array.array('c', "".join(text)) |
|
137 | arraytext = array.array('c', "".join(text)) | |
138 | cachedelta = None |
|
138 | cachedelta = None | |
139 | else: |
|
139 | else: | |
|
140 | added, removed = changed | |||
140 | addlist = self._mancache[2] |
|
141 | addlist = self._mancache[2] | |
141 |
|
142 | |||
142 |
checkforbidden( |
|
143 | checkforbidden(added) | |
143 | # combine the changed lists into one list for sorting |
|
144 | # combine the changed lists into one list for sorting | |
144 |
work = [ |
|
145 | work = [(x, False) for x in added] | |
145 |
work |
|
146 | work.extend((x, True) for x in removed) | |
|
147 | # this could use heapq.merge() (from python2.6+) or equivalent | |||
|
148 | # since the lists are already sorted | |||
146 | work.sort() |
|
149 | work.sort() | |
147 |
|
150 | |||
148 | delta = [] |
|
151 | delta = [] | |
@@ -155,18 +158,17 b' class manifest(revlog.revlog):' | |||||
155 |
|
158 | |||
156 | # start with a readonly loop that finds the offset of |
|
159 | # start with a readonly loop that finds the offset of | |
157 | # each line and creates the deltas |
|
160 | # each line and creates the deltas | |
158 |
for |
|
161 | for f, todelete in work: | |
159 | f = w[0] |
|
|||
160 | # bs will either be the index of the item or the insert point |
|
162 | # bs will either be the index of the item or the insert point | |
161 | start, end = self._search(addbuf, f, start) |
|
163 | start, end = self._search(addbuf, f, start) | |
162 |
if |
|
164 | if not todelete: | |
163 | l = "%s\000%s%s\n" % (f, revlog.hex(map[f]), map.flags(f)) |
|
165 | l = "%s\000%s%s\n" % (f, revlog.hex(map[f]), map.flags(f)) | |
164 | else: |
|
166 | else: | |
165 |
|
|
167 | if start == end: | |
166 | if start == end and w[1] == 1: |
|
|||
167 | # item we want to delete was not found, error out |
|
168 | # item we want to delete was not found, error out | |
168 | raise AssertionError( |
|
169 | raise AssertionError( | |
169 | _("failed to remove %s from manifest") % f) |
|
170 | _("failed to remove %s from manifest") % f) | |
|
171 | l = "" | |||
170 | if dstart != None and dstart <= start and dend >= start: |
|
172 | if dstart != None and dstart <= start and dend >= start: | |
171 | if dend < end: |
|
173 | if dend < end: | |
172 | dend = end |
|
174 | dend = end |
General Comments 0
You need to be logged in to leave comments.
Login now