##// END OF EJS Templates
verify: add check for mismatch of index and data length
Matt Mackall -
r1493:1a216cb4 default
parent child Browse files
Show More
@@ -1602,6 +1602,9 b' class localrepository:'
1602
1602
1603 seen = {}
1603 seen = {}
1604 self.ui.status(_("checking changesets\n"))
1604 self.ui.status(_("checking changesets\n"))
1605 d = self.changelog.checksize()
1606 if d:
1607 err(_("changeset data short %d bytes") % d)
1605 for i in range(self.changelog.count()):
1608 for i in range(self.changelog.count()):
1606 changesets += 1
1609 changesets += 1
1607 n = self.changelog.node(i)
1610 n = self.changelog.node(i)
@@ -1631,6 +1634,9 b' class localrepository:'
1631
1634
1632 seen = {}
1635 seen = {}
1633 self.ui.status(_("checking manifests\n"))
1636 self.ui.status(_("checking manifests\n"))
1637 d = self.manifest.checksize()
1638 if d:
1639 err(_("manifest data short %d bytes") % d)
1634 for i in range(self.manifest.count()):
1640 for i in range(self.manifest.count()):
1635 n = self.manifest.node(i)
1641 n = self.manifest.node(i)
1636 l = self.manifest.linkrev(n)
1642 l = self.manifest.linkrev(n)
@@ -1685,6 +1691,10 b' class localrepository:'
1685 if f == "/dev/null": continue
1691 if f == "/dev/null": continue
1686 files += 1
1692 files += 1
1687 fl = self.file(f)
1693 fl = self.file(f)
1694 d = fl.checksize()
1695 if d:
1696 err(_("%s file data short %d bytes") % (f, d))
1697
1688 nodes = { nullid: 1 }
1698 nodes = { nullid: 1 }
1689 seen = {}
1699 seen = {}
1690 for i in range(fl.count()):
1700 for i in range(fl.count()):
@@ -823,3 +823,12 b' class revlog:'
823 dfh.close()
823 dfh.close()
824 ifh.close()
824 ifh.close()
825 return node
825 return node
826
827 def checksize(self):
828 expected = 0
829 if self.count():
830 expected = self.end(self.count() - 1)
831 f = self.opener(self.datafile)
832 f.seek(0, 2)
833 actual = f.tell()
834 return expected - actual
General Comments 0
You need to be logged in to leave comments. Login now