~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2012-06-26 12:30:00 UTC
  • mto: This revision was merged to the branch mainline in revision 6533.
  • Revision ID: jelmer@samba.org-20120626123000-iehsbcvxkez6iv11
Remove deprecated Repository.get_ancestry().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1034
1034
        """
1035
1035
        raise NotImplementedError(self.revision_trees)
1036
1036
 
1037
 
    @needs_read_lock
1038
 
    @symbol_versioning.deprecated_method(
1039
 
        symbol_versioning.deprecated_in((2, 4, 0)))
1040
 
    def get_ancestry(self, revision_id, topo_sorted=True):
1041
 
        """Return a list of revision-ids integrated by a revision.
1042
 
 
1043
 
        The first element of the list is always None, indicating the origin
1044
 
        revision.  This might change when we have history horizons, or
1045
 
        perhaps we should have a new API.
1046
 
 
1047
 
        This is topologically sorted.
1048
 
        """
1049
 
        if 'evil' in debug.debug_flags:
1050
 
            mutter_callsite(2, "get_ancestry is linear with history.")
1051
 
        if _mod_revision.is_null(revision_id):
1052
 
            return [None]
1053
 
        if not self.has_revision(revision_id):
1054
 
            raise errors.NoSuchRevision(self, revision_id)
1055
 
        graph = self.get_graph()
1056
 
        keys = set()
1057
 
        search = graph._make_breadth_first_searcher([revision_id])
1058
 
        while True:
1059
 
            try:
1060
 
                found, ghosts = search.next_with_ghosts()
1061
 
            except StopIteration:
1062
 
                break
1063
 
            keys.update(found)
1064
 
        if _mod_revision.NULL_REVISION in keys:
1065
 
            keys.remove(_mod_revision.NULL_REVISION)
1066
 
        if topo_sorted:
1067
 
            parent_map = graph.get_parent_map(keys)
1068
 
            keys = tsort.topo_sort(parent_map)
1069
 
        return [None] + list(keys)
1070
 
 
1071
1037
    def pack(self, hint=None, clean_obsolete_packs=False):
1072
1038
        """Compress the data within the repository.
1073
1039