Show More
@@ -2566,11 +2566,14 b' def cat(ui, repo, ctx, matcher, prefix, ' | |||
|
2566 | 2566 | # for performance to avoid the cost of parsing the manifest. |
|
2567 | 2567 | if len(matcher.files()) == 1 and not matcher.anypats(): |
|
2568 | 2568 | file = matcher.files()[0] |
|
2569 | mf = repo.manifest | |
|
2569 | mfl = repo.manifestlog | |
|
2570 | 2570 | mfnode = ctx.manifestnode() |
|
2571 | if mfnode and mf.find(mfnode, file)[0]: | |
|
2571 | try: | |
|
2572 | if mfnode and mfl[mfnode].find(file)[0]: | |
|
2572 | 2573 | write(file) |
|
2573 | 2574 | return 0 |
|
2575 | except KeyError: | |
|
2576 | pass | |
|
2574 | 2577 | |
|
2575 | 2578 | for abs in ctx.walk(matcher): |
|
2576 | 2579 | write(abs) |
@@ -259,8 +259,10 b' class basectx(object):' | |||
|
259 | 259 | if path in self._manifestdelta: |
|
260 | 260 | return (self._manifestdelta[path], |
|
261 | 261 | self._manifestdelta.flags(path)) |
|
262 |
|
|
|
263 |
|
|
|
262 | mfl = self._repo.manifestlog | |
|
263 | try: | |
|
264 | node, flag = mfl[self._changeset.manifest].find(path) | |
|
265 | except KeyError: | |
|
264 | 266 | raise error.ManifestLookupError(self._node, path, |
|
265 | 267 | _('not found in manifest')) |
|
266 | 268 |
@@ -1394,6 +1394,9 b' class manifestctx(object):' | |||
|
1394 | 1394 | d = mdiff.patchtext(revlog.revdiff(revlog.deltaparent(r), r)) |
|
1395 | 1395 | return manifestdict(d) |
|
1396 | 1396 | |
|
1397 | def find(self, key): | |
|
1398 | return self.read().find(key) | |
|
1399 | ||
|
1397 | 1400 | class treemanifestctx(object): |
|
1398 | 1401 | def __init__(self, repo, dir, node): |
|
1399 | 1402 | self._repo = repo |
@@ -1486,6 +1489,9 b' class treemanifestctx(object):' | |||
|
1486 | 1489 | else: |
|
1487 | 1490 | return self.read() |
|
1488 | 1491 | |
|
1492 | def find(self, key): | |
|
1493 | return self.read().find(key) | |
|
1494 | ||
|
1489 | 1495 | class manifest(manifestrevlog): |
|
1490 | 1496 | def __init__(self, opener, dir='', dirlogcache=None): |
|
1491 | 1497 | '''The 'dir' and 'dirlogcache' arguments are for internal use by |
@@ -1548,15 +1554,6 b' class manifest(manifestrevlog):' | |||
|
1548 | 1554 | self.fulltextcache[node] = arraytext |
|
1549 | 1555 | return m |
|
1550 | 1556 | |
|
1551 | def find(self, node, f): | |
|
1552 | '''look up entry for a single file efficiently. | |
|
1553 | return (node, flags) pair if found, (None, None) if not.''' | |
|
1554 | m = self.read(node) | |
|
1555 | try: | |
|
1556 | return m.find(f) | |
|
1557 | except KeyError: | |
|
1558 | return None, None | |
|
1559 | ||
|
1560 | 1557 | def clearcaches(self): |
|
1561 | 1558 | super(manifest, self).clearcaches() |
|
1562 | 1559 | self._mancache.clear() |
General Comments 0
You need to be logged in to leave comments.
Login now