Show More
@@ -1278,9 +1278,12 b' class manifestlog(object):' | |||||
1278 | """ |
|
1278 | """ | |
1279 | return self.get('', node) |
|
1279 | return self.get('', node) | |
1280 |
|
1280 | |||
1281 | def get(self, dir, node): |
|
1281 | def get(self, dir, node, verify=True): | |
1282 | """Retrieves the manifest instance for the given node. Throws a |
|
1282 | """Retrieves the manifest instance for the given node. Throws a | |
1283 | LookupError if not found. |
|
1283 | LookupError if not found. | |
|
1284 | ||||
|
1285 | `verify` - if True an exception will be thrown if the node is not in | |||
|
1286 | the revlog | |||
1284 | """ |
|
1287 | """ | |
1285 | if node in self._dirmancache.get(dir, ()): |
|
1288 | if node in self._dirmancache.get(dir, ()): | |
1286 | cachemf = self._dirmancache[dir][node] |
|
1289 | cachemf = self._dirmancache[dir][node] | |
@@ -1292,19 +1295,21 b' class manifestlog(object):' | |||||
1292 |
|
1295 | |||
1293 | if dir: |
|
1296 | if dir: | |
1294 | if self._revlog._treeondisk: |
|
1297 | if self._revlog._treeondisk: | |
1295 | dirlog = self._revlog.dirlog(dir) |
|
1298 | if verify: | |
1296 | if node not in dirlog.nodemap: |
|
1299 | dirlog = self._revlog.dirlog(dir) | |
1297 |
|
|
1300 | if node not in dirlog.nodemap: | |
1298 | _('no node')) |
|
1301 | raise LookupError(node, dirlog.indexfile, | |
|
1302 | _('no node')) | |||
1299 | m = treemanifestctx(self._repo, dir, node) |
|
1303 | m = treemanifestctx(self._repo, dir, node) | |
1300 | else: |
|
1304 | else: | |
1301 | raise error.Abort( |
|
1305 | raise error.Abort( | |
1302 | _("cannot ask for manifest directory '%s' in a flat " |
|
1306 | _("cannot ask for manifest directory '%s' in a flat " | |
1303 | "manifest") % dir) |
|
1307 | "manifest") % dir) | |
1304 | else: |
|
1308 | else: | |
1305 | if node not in self._revlog.nodemap: |
|
1309 | if verify: | |
1306 |
|
|
1310 | if node not in self._revlog.nodemap: | |
1307 | _('no node')) |
|
1311 | raise LookupError(node, self._revlog.indexfile, | |
|
1312 | _('no node')) | |||
1308 | if self._treeinmem: |
|
1313 | if self._treeinmem: | |
1309 | m = treemanifestctx(self._repo, '', node) |
|
1314 | m = treemanifestctx(self._repo, '', node) | |
1310 | else: |
|
1315 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now