Show More
@@ -48,11 +48,11 b' class manifestdict(dict):' | |||||
48 | (not match.anypats() and util.all(fn in self for fn in files))): |
|
48 | (not match.anypats() and util.all(fn in self for fn in files))): | |
49 | return self.intersectfiles(files) |
|
49 | return self.intersectfiles(files) | |
50 |
|
50 | |||
51 |
m |
|
51 | m = self.copy() | |
52 |
for fn in m |
|
52 | for fn in m.keys(): | |
53 | if not match(fn): |
|
53 | if not match(fn): | |
54 |
del m |
|
54 | del m[fn] | |
55 |
return m |
|
55 | return m | |
56 |
|
56 | |||
57 | def diff(self, m2, clean=False): |
|
57 | def diff(self, m2, clean=False): | |
58 | '''Finds changes between the current manifest and m2. |
|
58 | '''Finds changes between the current manifest and m2. | |
@@ -247,16 +247,16 b' class manifest(revlog.revlog):' | |||||
247 | return self._mancache[node][0] |
|
247 | return self._mancache[node][0] | |
248 | text = self.revision(node) |
|
248 | text = self.revision(node) | |
249 | arraytext = array.array('c', text) |
|
249 | arraytext = array.array('c', text) | |
250 |
m |
|
250 | m = _parse(text) | |
251 |
self._mancache[node] = (m |
|
251 | self._mancache[node] = (m, arraytext) | |
252 |
return m |
|
252 | return m | |
253 |
|
253 | |||
254 | def find(self, node, f): |
|
254 | def find(self, node, f): | |
255 | '''look up entry for a single file efficiently. |
|
255 | '''look up entry for a single file efficiently. | |
256 | return (node, flags) pair if found, (None, None) if not.''' |
|
256 | return (node, flags) pair if found, (None, None) if not.''' | |
257 | if node in self._mancache: |
|
257 | if node in self._mancache: | |
258 |
m |
|
258 | m = self._mancache[node][0] | |
259 |
return m |
|
259 | return m.get(f), m.flags(f) | |
260 | text = self.revision(node) |
|
260 | text = self.revision(node) | |
261 | start, end = _msearch(text, f) |
|
261 | start, end = _msearch(text, f) | |
262 | if start == end: |
|
262 | if start == end: | |
@@ -265,7 +265,7 b' class manifest(revlog.revlog):' | |||||
265 | f, n = l.split('\0') |
|
265 | f, n = l.split('\0') | |
266 | return revlog.bin(n[:40]), n[40:-1] |
|
266 | return revlog.bin(n[:40]), n[40:-1] | |
267 |
|
267 | |||
268 |
def add(self, m |
|
268 | def add(self, m, transaction, link, p1, p2, added, removed): | |
269 | if p1 in self._mancache: |
|
269 | if p1 in self._mancache: | |
270 | # If our first parent is in the manifest cache, we can |
|
270 | # If our first parent is in the manifest cache, we can | |
271 | # compute a delta here using properties we know about the |
|
271 | # compute a delta here using properties we know about the | |
@@ -280,7 +280,7 b' class manifest(revlog.revlog):' | |||||
280 | # since the lists are already sorted |
|
280 | # since the lists are already sorted | |
281 | work.sort() |
|
281 | work.sort() | |
282 |
|
282 | |||
283 |
arraytext, deltatext = m |
|
283 | arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work) | |
284 | cachedelta = self.rev(p1), deltatext |
|
284 | cachedelta = self.rev(p1), deltatext | |
285 | text = util.buffer(arraytext) |
|
285 | text = util.buffer(arraytext) | |
286 | else: |
|
286 | else: | |
@@ -288,11 +288,11 b' class manifest(revlog.revlog):' | |||||
288 | # just encode a fulltext of the manifest and pass that |
|
288 | # just encode a fulltext of the manifest and pass that | |
289 | # through to the revlog layer, and let it handle the delta |
|
289 | # through to the revlog layer, and let it handle the delta | |
290 | # process. |
|
290 | # process. | |
291 |
text = m |
|
291 | text = m.text() | |
292 | arraytext = array.array('c', text) |
|
292 | arraytext = array.array('c', text) | |
293 | cachedelta = None |
|
293 | cachedelta = None | |
294 |
|
294 | |||
295 | n = self.addrevision(text, transaction, link, p1, p2, cachedelta) |
|
295 | n = self.addrevision(text, transaction, link, p1, p2, cachedelta) | |
296 |
self._mancache[n] = (m |
|
296 | self._mancache[n] = (m, arraytext) | |
297 |
|
297 | |||
298 | return n |
|
298 | return n |
General Comments 0
You need to be logged in to leave comments.
Login now