~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

  • Committer: Andrew Bennetts
  • Date: 2007-09-28 04:10:43 UTC
  • mto: This revision was merged to the branch mainline in revision 2905.
  • Revision ID: andrew.bennetts@canonical.com-20070928041043-kw5wdguzznj8rw9w
Add VersionedFile.check_parents, and use it instead of find_bad_ancestors in reconcile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
            self.pb.update('Fixing text parents', num,
361
361
                           len(self.repo.weave_store))
362
362
            vf = self.repo.weave_store.get_weave(file_id, transaction)
363
 
            bad_ancestors = vf.find_bad_ancestors(
 
363
#            bad_ancestors = vf.find_bad_ancestors(
 
364
#                self.revisions.versions(),
 
365
#                revision_versions.get_text_version,
 
366
#                file_id,
 
367
#                revision_parents,
 
368
#                self.repo.get_graph())
 
369
            bad_ancestors = []
 
370
            bad_parents = vf.check_parents(
364
371
                self.revisions.versions(),
365
372
                revision_versions.get_text_version,
366
373
                file_id,
367
374
                revision_parents,
368
 
                self.repo.get_graph())
369
 
            if len(bad_ancestors) == 0:
 
375
                self.repo.get_graph(),
 
376
                self.repo.get_inventory)
 
377
            if len(bad_ancestors) == 0 and len(bad_parents) == 0:
370
378
                continue
 
379
            #mutter('bad_parents: %r', bad_parents)
371
380
            new_vf = self.repo.weave_store.get_empty('temp:%s' % file_id,
372
381
                self.transaction)
373
382
            new_parents = {}
375
384
                parents = vf.get_parents(version)
376
385
                for parent_id in parents:
377
386
                    if (parent_id in bad_ancestors and
378
 
                        version in bad_ancestors[parent_id]):
 
387
                        version in bad_ancestors[parent_id]
 
388
                        ) or (version in bad_parents):
379
389
                        parents = self._find_correct_parents(version,
380
390
                            file_id, revision_versions, revision_graph)
381
391
                        break