2765
2765
except UnicodeDecodeError:
2766
2766
raise errors.NonAsciiRevisionId(method, self)
2768
def _find_inconsistent_revision_parents(self, revisions_iterator=None):
2769
"""Find revisions with different parent lists in the revision object
2770
and in the index graph.
2772
:param revisions_iterator: None, or an iterator of (revid,
2773
Revision-or-None). This iterator controls the revisions checked.
2774
:returns: an iterator yielding tuples of (revison-id, parents-in-index,
2775
parents-in-revision).
2777
if not self.is_locked():
2778
raise AssertionError()
2780
if revisions_iterator is None:
2781
revisions_iterator = self._iter_revisions(None)
2782
for revid, revision in revisions_iterator:
2783
if revision is None:
2785
parent_map = vf.get_parent_map([(revid,)])
2786
parents_according_to_index = tuple(parent[-1] for parent in
2787
parent_map[(revid,)])
2788
parents_according_to_revision = tuple(revision.parent_ids)
2789
if parents_according_to_index != parents_according_to_revision:
2790
yield (revid, parents_according_to_index,
2791
parents_according_to_revision)
2793
def _check_for_inconsistent_revision_parents(self):
2794
inconsistencies = list(self._find_inconsistent_revision_parents())
2796
raise errors.BzrCheckError(
2797
"Revision knit has inconsistent parents.")
2769
2800
def install_revision(repository, rev, revision_tree):
2770
2801
"""Install all revision data into a repository."""