equal
deleted
inserted
replaced
1657 """ |
1657 """ |
1658 try: |
1658 try: |
1659 if p1 is None and p2 is None: |
1659 if p1 is None and p2 is None: |
1660 p1, p2 = self.parents(node) |
1660 p1, p2 = self.parents(node) |
1661 if node != self.hash(text, p1, p2): |
1661 if node != self.hash(text, p1, p2): |
|
1662 # Clear the revision cache on hash failure. The revision cache |
|
1663 # only stores the raw revision and clearing the cache does have |
|
1664 # the side-effect that we won't have a cache hit when the raw |
|
1665 # revision data is accessed. But this case should be rare and |
|
1666 # it is extra work to teach the cache about the hash |
|
1667 # verification state. |
|
1668 if self._revisioncache and self._revisioncache[0] == node: |
|
1669 self._revisioncache = None |
|
1670 |
1662 revornode = rev |
1671 revornode = rev |
1663 if revornode is None: |
1672 if revornode is None: |
1664 revornode = templatefilters.short(hex(node)) |
1673 revornode = templatefilters.short(hex(node)) |
1665 raise error.RevlogError(_("integrity check failed on %s:%s") |
1674 raise error.RevlogError(_("integrity check failed on %s:%s") |
1666 % (self.indexfile, pycompat.bytestr(revornode))) |
1675 % (self.indexfile, pycompat.bytestr(revornode))) |