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

  • Committer: Robert Collins
  • Date: 2008-03-19 04:39:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3306.
  • Revision ID: robertc@robertcollins.net-20080319043904-7g4imzvybc7q9l8h
Deprecate VersionedFile.get_parents, breaking pulling from a ghost containing knit or pack repository to weaves, which improves correctness and allows simplification of core code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1607
1607
            done.add(revision_id)
1608
1608
        return result
1609
1609
 
1610
 
    def _get_history_vf(self):
1611
 
        """Get a versionedfile whose history graph reflects all revisions.
1612
 
 
1613
 
        For weave repositories, this is the inventory weave.
1614
 
        """
1615
 
        return self.get_inventory_weave()
1616
 
 
1617
1610
    def iter_reverse_revision_history(self, revision_id):
1618
1611
        """Iterate backwards through revision ids in the lefthand history
1619
1612
 
1620
1613
        :param revision_id: The revision id to start with.  All its lefthand
1621
1614
            ancestors will be traversed.
1622
1615
        """
1623
 
        if revision_id in (None, _mod_revision.NULL_REVISION):
1624
 
            return
 
1616
        graph = self.get_graph()
1625
1617
        next_id = revision_id
1626
 
        versionedfile = self._get_history_vf()
1627
1618
        while True:
 
1619
            if next_id in (None, _mod_revision.NULL_REVISION):
 
1620
                return
1628
1621
            yield next_id
1629
 
            parents = versionedfile.get_parents(next_id)
 
1622
            parents = graph.get_parent_map([next_id])[next_id]
1630
1623
            if len(parents) == 0:
1631
1624
                return
1632
1625
            else:
3124
3117
        """
3125
3118
        wrong_parents = {}
3126
3119
        unused_versions = set()
3127
 
        for num, revision_id in enumerate(weave.versions()):
 
3120
        versions = weave.versions()
 
3121
        parent_map = weave.get_parent_map(versions)
 
3122
        for num, revision_id in enumerate(versions):
3128
3123
            try:
3129
3124
                correct_parents = self.calculate_file_version_parents(
3130
3125
                    revision_id, file_id)
3133
3128
                unused_versions.add(revision_id)
3134
3129
            else:
3135
3130
                try:
3136
 
                    knit_parents = tuple(weave.get_parents(revision_id))
 
3131
                    knit_parents = tuple(parent_map[revision_id])
3137
3132
                except errors.RevisionNotPresent:
3138
3133
                    knit_parents = None
3139
3134
                if correct_parents != knit_parents: