Show More
@@ -1365,6 +1365,12 b' class manifestctx(object):' | |||||
1365 | return self.read() |
|
1365 | return self.read() | |
1366 |
|
1366 | |||
1367 | def readdelta(self, shallow=False): |
|
1367 | def readdelta(self, shallow=False): | |
|
1368 | '''Returns a manifest containing just the entries that are present | |||
|
1369 | in this manifest, but not in its p1 manifest. This is efficient to read | |||
|
1370 | if the revlog delta is already p1. | |||
|
1371 | ||||
|
1372 | Changing the value of `shallow` has no effect on flat manifests. | |||
|
1373 | ''' | |||
1368 | revlog = self._repo.manifestlog._revlog |
|
1374 | revlog = self._repo.manifestlog._revlog | |
1369 | if revlog._usemanifestv2: |
|
1375 | if revlog._usemanifestv2: | |
1370 | # Need to perform a slow delta |
|
1376 | # Need to perform a slow delta | |
@@ -1427,6 +1433,16 b' class treemanifestctx(object):' | |||||
1427 | return self._node |
|
1433 | return self._node | |
1428 |
|
1434 | |||
1429 | def readdelta(self, shallow=False): |
|
1435 | def readdelta(self, shallow=False): | |
|
1436 | '''Returns a manifest containing just the entries that are present | |||
|
1437 | in this manifest, but not in its p1 manifest. This is efficient to read | |||
|
1438 | if the revlog delta is already p1. | |||
|
1439 | ||||
|
1440 | If `shallow` is True, this will read the delta for this directory, | |||
|
1441 | without recursively reading subdirectory manifests. Instead, any | |||
|
1442 | subdirectory entry will be reported as it appears in the manifest, i.e. | |||
|
1443 | the subdirectory will be reported among files and distinguished only by | |||
|
1444 | its 't' flag. | |||
|
1445 | ''' | |||
1430 | revlog = self._revlog() |
|
1446 | revlog = self._revlog() | |
1431 | if shallow and not revlog._usemanifestv2: |
|
1447 | if shallow and not revlog._usemanifestv2: | |
1432 | r = revlog.rev(self._node) |
|
1448 | r = revlog.rev(self._node) | |
@@ -1500,41 +1516,6 b' class manifest(manifestrevlog):' | |||||
1500 | self._dirlogcache) |
|
1516 | self._dirlogcache) | |
1501 | return self._dirlogcache[dir] |
|
1517 | return self._dirlogcache[dir] | |
1502 |
|
1518 | |||
1503 | def _slowreaddelta(self, node): |
|
|||
1504 | r0 = self.deltaparent(self.rev(node)) |
|
|||
1505 | m0 = self.read(self.node(r0)) |
|
|||
1506 | m1 = self.read(node) |
|
|||
1507 | md = self._newmanifest() |
|
|||
1508 | for f, ((n0, fl0), (n1, fl1)) in m0.diff(m1).iteritems(): |
|
|||
1509 | if n1: |
|
|||
1510 | md[f] = n1 |
|
|||
1511 | if fl1: |
|
|||
1512 | md.setflag(f, fl1) |
|
|||
1513 | return md |
|
|||
1514 |
|
||||
1515 | def readdelta(self, node): |
|
|||
1516 | if self._usemanifestv2 or self._treeondisk: |
|
|||
1517 | return self._slowreaddelta(node) |
|
|||
1518 | r = self.rev(node) |
|
|||
1519 | d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r)) |
|
|||
1520 | return self._newmanifest(d) |
|
|||
1521 |
|
||||
1522 | def readshallowdelta(self, node): |
|
|||
1523 | '''For flat manifests, this is the same as readdelta(). For |
|
|||
1524 | treemanifests, this will read the delta for this revlog's directory, |
|
|||
1525 | without recursively reading subdirectory manifests. Instead, any |
|
|||
1526 | subdirectory entry will be reported as it appears in the manifests, i.e. |
|
|||
1527 | the subdirectory will be reported among files and distinguished only by |
|
|||
1528 | its 't' flag.''' |
|
|||
1529 | if not self._treeondisk: |
|
|||
1530 | return self.readdelta(node) |
|
|||
1531 | if self._usemanifestv2: |
|
|||
1532 | raise error.Abort( |
|
|||
1533 | _("readshallowdelta() not implemented for manifestv2")) |
|
|||
1534 | r = self.rev(node) |
|
|||
1535 | d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r)) |
|
|||
1536 | return manifestdict(d) |
|
|||
1537 |
|
||||
1538 | def read(self, node): |
|
1519 | def read(self, node): | |
1539 | if node == revlog.nullid: |
|
1520 | if node == revlog.nullid: | |
1540 | return self._newmanifest() # don't upset local cache |
|
1521 | return self._newmanifest() # don't upset local cache |
@@ -201,7 +201,8 b' class verifier(object):' | |||||
201 | progress=None): |
|
201 | progress=None): | |
202 | repo = self.repo |
|
202 | repo = self.repo | |
203 | ui = self.ui |
|
203 | ui = self.ui | |
204 |
mf = self.repo.manifest |
|
204 | mfl = self.repo.manifestlog | |
|
205 | mf = mfl._revlog.dirlog(dir) | |||
205 |
|
206 | |||
206 | if not dir: |
|
207 | if not dir: | |
207 | self.ui.status(_("checking manifests\n")) |
|
208 | self.ui.status(_("checking manifests\n")) | |
@@ -235,7 +236,8 b' class verifier(object):' | |||||
235 | self.err(lr, _("%s not in changesets") % short(n), label) |
|
236 | self.err(lr, _("%s not in changesets") % short(n), label) | |
236 |
|
237 | |||
237 | try: |
|
238 | try: | |
238 | for f, fn, fl in mf.readshallowdelta(n).iterentries(): |
|
239 | mfdelta = mfl.get(dir, n).readdelta(shallow=True) | |
|
240 | for f, fn, fl in mfdelta.iterentries(): | |||
239 | if not f: |
|
241 | if not f: | |
240 | self.err(lr, _("entry without name in manifest")) |
|
242 | self.err(lr, _("entry without name in manifest")) | |
241 | elif f == "/dev/null": # ignore this in very old repos |
|
243 | elif f == "/dev/null": # ignore this in very old repos |
General Comments 0
You need to be logged in to leave comments.
Login now