/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: Aaron Bentley
  • Date: 2007-12-20 15:21:48 UTC
  • mfrom: (3134 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3135.
  • Revision ID: abentley@panoramicfeedback.com-20071220152148-rn32up72gm3gankf
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1643
1643
    def revision_parents(self, revision_id):
1644
1644
        return self.get_inventory_weave().parent_names(revision_id)
1645
1645
 
 
1646
    @deprecated_method(symbol_versioning.one_one)
1646
1647
    def get_parents(self, revision_ids):
1647
1648
        """See StackedParentsProvider.get_parents"""
1648
 
        parents_list = []
1649
 
        for revision_id in revision_ids:
 
1649
        parent_map = self.get_parent_map(revision_ids)
 
1650
        return [parent_map.get(r, None) for r in revision_ids]
 
1651
 
 
1652
    def get_parent_map(self, keys):
 
1653
        """See graph._StackedParentsProvider.get_parent_map"""
 
1654
        parent_map = {}
 
1655
        for revision_id in keys:
1650
1656
            if revision_id == _mod_revision.NULL_REVISION:
1651
 
                parents = []
 
1657
                parent_map[revision_id] = []
1652
1658
            else:
1653
1659
                try:
1654
 
                    parents = self.get_revision(revision_id).parent_ids
 
1660
                    parent_ids = self.get_revision(revision_id).parent_ids
1655
1661
                except errors.NoSuchRevision:
1656
 
                    parents = None
 
1662
                    pass
1657
1663
                else:
1658
 
                    if len(parents) == 0:
1659
 
                        parents = [_mod_revision.NULL_REVISION]
1660
 
            parents_list.append(parents)
1661
 
        return parents_list
 
1664
                    if len(parent_ids) == 0:
 
1665
                        parent_ids = [_mod_revision.NULL_REVISION]
 
1666
                    parent_map[revision_id] = parent_ids
 
1667
        return parent_map
1662
1668
 
1663
1669
    def _make_parents_provider(self):
1664
1670
        return self
1958
1964
    _matchingbzrdir - the bzrdir format that the repository format was
1959
1965
    originally written to work with. This can be used if manually
1960
1966
    constructing a bzrdir and repository, or more commonly for test suite
1961
 
    parameterisation.
 
1967
    parameterization.
1962
1968
    """
1963
1969
 
1964
1970
    # Set to True or False in derived classes. True indicates that the format