/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Andrew Bennetts
  • Date: 2007-10-12 08:18:54 UTC
  • mfrom: (2905 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2906.
  • Revision ID: andrew.bennetts@canonical.com-20071012081854-6wjgjhjjdy55s84i
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
            _revision_store, control_store, text_store)
91
91
        self._commit_builder_class = _commit_builder_class
92
92
        self._serializer = _serializer
 
93
        self._reconcile_fixes_text_parents = True
93
94
 
94
95
    def _warn_if_deprecated(self):
95
96
        # This class isn't deprecated
268
269
    def _make_parents_provider(self):
269
270
        return _KnitParentsProvider(self._get_revision_vf())
270
271
 
 
272
    def _find_inconsistent_revision_parents(self):
 
273
        """Find revisions with different parent lists in the revision object
 
274
        and in the index graph.
 
275
 
 
276
        :returns: an iterator yielding tuples of (revison-id, parents-in-index,
 
277
            parents-in-revision).
 
278
        """
 
279
        vf = self._get_revision_vf()
 
280
        index_versions = vf.versions()
 
281
        for index_version in index_versions:
 
282
            parents_according_to_index = vf._index.get_parents_with_ghosts(
 
283
                index_version)
 
284
            revision = self._revision_store.get_revision(index_version,
 
285
                self.get_transaction())
 
286
            parents_according_to_revision = revision.parent_ids
 
287
            if parents_according_to_index != parents_according_to_revision:
 
288
                yield (index_version, parents_according_to_index,
 
289
                    parents_according_to_revision)
 
290
 
 
291
    def _check_for_inconsistent_revision_parents(self):
 
292
        inconsistencies = list(self._find_inconsistent_revision_parents())
 
293
        if inconsistencies:
 
294
            raise errors.BzrCheckError(
 
295
                "Revision knit has inconsistent parents.")
 
296
 
 
297
    def revision_graph_can_have_wrong_parents(self):
 
298
        # The revision.kndx could potentially claim a revision has a different
 
299
        # parent to the revision text.
 
300
        return True
 
301
 
271
302
 
272
303
class RepositoryFormatKnit(MetaDirRepositoryFormat):
273
304
    """Bzr repository knit format (generalized).