237
237
def _make_parents_provider(self):
238
238
return _KnitParentsProvider(self._get_revision_vf())
240
def _find_inconsistent_revision_parents(self):
241
"""Find revisions with different parent lists in the revision object
242
and in the index graph.
244
:returns: an iterator yielding tuples of (revison-id, parents-in-index,
245
parents-in-revision).
247
vf = self._get_revision_vf()
248
index_versions = vf.versions()
249
for index_version in index_versions:
250
parents_according_to_index = vf._index.get_parents_with_ghosts(
252
revision = self._revision_store.get_revision(index_version,
253
self.get_transaction())
254
parents_according_to_revision = revision.parent_ids
255
if parents_according_to_index != parents_according_to_revision:
256
yield (index_version, parents_according_to_index,
257
parents_according_to_revision)
259
def _check_for_inconsistent_revision_parents(self):
260
inconsistencies = list(self._find_inconsistent_revision_parents())
262
raise errors.BzrCheckError(
263
"Revision knit has inconsistent parents.")
265
def revision_graph_can_have_wrong_parents(self):
266
# The revision.kndx could potentially claim a revision has a different
267
# parent to the revision text.
241
271
class KnitRepository3(KnitRepository):