/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/reconcile.py

  • Committer: Aaron Bentley
  • Date: 2007-08-29 00:42:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2905.
  • Revision ID: aaron.bentley@utoronto.ca-20070829004227-q89oifuqul7ozbkv
Update from review

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
 
23
23
from bzrlib import (
 
24
    errors,
24
25
    graph,
25
26
    ui,
26
27
    repository,
345
346
    def _fix_text_parents(self):
346
347
        """Fix bad versionedfile parent entries.
347
348
 
348
 
        It is possible for the parents entrie in a versionedfile entry to be
 
349
        It is possible for the parents entry in a versionedfile entry to be
349
350
        inconsistent with the values in the revision and inventory.
350
351
 
351
352
        This method finds entries with such inconsistencies, corrects their
354
355
        transaction = self.repo.get_transaction()
355
356
        revision_parents = repository._RevisionParentsProvider(self.repo)
356
357
        revision_graph = graph.Graph(revision_parents)
357
 
        revision_versions = {}
 
358
        revision_versions = repository._RevisionTextVersionCache(self.repo)
358
359
        for num, file_id in enumerate(self.repo.weave_store):
359
360
            self.pb.update('Fixing text parents', num,
360
361
                           len(self.repo.weave_store))
390
391
            return []
391
392
        for parent_id in rev_parents:
392
393
            try:
393
 
                parent_id = revision_versions[parent_id][file_id]
394
 
            except KeyError:
 
394
                parent_id = revision_versions.get_text_version(file_id,
 
395
                                                               parent_id)
 
396
            except errors.RevisionNotPresent:
395
397
                continue
396
 
            if parent_id not in parents:
 
398
            if parent_id is not None and parent_id not in parents:
397
399
                parents.append(parent_id)
398
400
        non_heads = set()
399
401
        for num, parent in enumerate(parents):