~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2012-07-06 11:27:16 UTC
  • mfrom: (6534 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6535.
  • Revision ID: jelmer@samba.org-20120706112716-jcun7vvbpgmcplgz
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

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