Show More
@@ -1435,31 +1435,31 b' class manifestlog(object):' | |||||
1435 | """ |
|
1435 | """ | |
1436 | return self.get('', node) |
|
1436 | return self.get('', node) | |
1437 |
|
1437 | |||
1438 |
def get(self, |
|
1438 | def get(self, tree, node, verify=True): | |
1439 | """Retrieves the manifest instance for the given node. Throws a |
|
1439 | """Retrieves the manifest instance for the given node. Throws a | |
1440 | LookupError if not found. |
|
1440 | LookupError if not found. | |
1441 |
|
1441 | |||
1442 | `verify` - if True an exception will be thrown if the node is not in |
|
1442 | `verify` - if True an exception will be thrown if the node is not in | |
1443 | the revlog |
|
1443 | the revlog | |
1444 | """ |
|
1444 | """ | |
1445 |
if node in self._dirmancache.get( |
|
1445 | if node in self._dirmancache.get(tree, ()): | |
1446 |
return self._dirmancache[ |
|
1446 | return self._dirmancache[tree][node] | |
1447 |
|
1447 | |||
1448 | if not self._narrowmatch.always(): |
|
1448 | if not self._narrowmatch.always(): | |
1449 |
if not self._narrowmatch.visitdir( |
|
1449 | if not self._narrowmatch.visitdir(tree[:-1] or '.'): | |
1450 |
return excludeddirmanifestctx( |
|
1450 | return excludeddirmanifestctx(tree, node) | |
1451 |
if |
|
1451 | if tree: | |
1452 | if self._revlog._treeondisk: |
|
1452 | if self._revlog._treeondisk: | |
1453 | if verify: |
|
1453 | if verify: | |
1454 |
dirlog = self._revlog.dirlog( |
|
1454 | dirlog = self._revlog.dirlog(tree) | |
1455 | if node not in dirlog.nodemap: |
|
1455 | if node not in dirlog.nodemap: | |
1456 | raise LookupError(node, dirlog.indexfile, |
|
1456 | raise LookupError(node, dirlog.indexfile, | |
1457 | _('no node')) |
|
1457 | _('no node')) | |
1458 |
m = treemanifestctx(self, |
|
1458 | m = treemanifestctx(self, tree, node) | |
1459 | else: |
|
1459 | else: | |
1460 | raise error.Abort( |
|
1460 | raise error.Abort( | |
1461 | _("cannot ask for manifest directory '%s' in a flat " |
|
1461 | _("cannot ask for manifest directory '%s' in a flat " | |
1462 |
"manifest") % |
|
1462 | "manifest") % tree) | |
1463 | else: |
|
1463 | else: | |
1464 | if verify: |
|
1464 | if verify: | |
1465 | if node not in self._revlog.nodemap: |
|
1465 | if node not in self._revlog.nodemap: | |
@@ -1471,10 +1471,10 b' class manifestlog(object):' | |||||
1471 | m = manifestctx(self, node) |
|
1471 | m = manifestctx(self, node) | |
1472 |
|
1472 | |||
1473 | if node != revlog.nullid: |
|
1473 | if node != revlog.nullid: | |
1474 |
mancache = self._dirmancache.get( |
|
1474 | mancache = self._dirmancache.get(tree) | |
1475 | if not mancache: |
|
1475 | if not mancache: | |
1476 | mancache = util.lrucachedict(self._cachesize) |
|
1476 | mancache = util.lrucachedict(self._cachesize) | |
1477 |
self._dirmancache[ |
|
1477 | self._dirmancache[tree] = mancache | |
1478 | mancache[node] = m |
|
1478 | mancache[node] = m | |
1479 | return m |
|
1479 | return m | |
1480 |
|
1480 |
@@ -1000,15 +1000,15 b' class imanifestlog(interfaceutil.Interfa' | |||||
1000 | interface. |
|
1000 | interface. | |
1001 | """ |
|
1001 | """ | |
1002 |
|
1002 | |||
1003 |
def get( |
|
1003 | def get(tree, node, verify=True): | |
1004 | """Retrieve the manifest instance for a given directory and binary node. |
|
1004 | """Retrieve the manifest instance for a given directory and binary node. | |
1005 |
|
1005 | |||
1006 | ``node`` always refers to the node of the root manifest (which will be |
|
1006 | ``node`` always refers to the node of the root manifest (which will be | |
1007 | the only manifest if flat manifests are being used). |
|
1007 | the only manifest if flat manifests are being used). | |
1008 |
|
1008 | |||
1009 |
If `` |
|
1009 | If ``tree`` is the empty string, the root manifest is returned. | |
1010 |
the manifest for the specified directory will be returned |
|
1010 | Otherwise the manifest for the specified directory will be returned | |
1011 | tree manifests). |
|
1011 | (requires tree manifests). | |
1012 |
|
1012 | |||
1013 | If ``verify`` is True, ``LookupError`` is raised if the node is not |
|
1013 | If ``verify`` is True, ``LookupError`` is raised if the node is not | |
1014 | known. |
|
1014 | known. |
General Comments 0
You need to be logged in to leave comments.
Login now