~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-21 05:22:37 UTC
  • mfrom: (2490.2.33 graphwalker)
  • Revision ID: pqm@pqm.ubuntu.com-20070621052237-2phm1z5dg4arrwnk
Avoid topological sorting in Repository.get_ancestry where possible

Show diffs side-by-side

added added

removed removed

Lines of Context:
819
819
            yield RevisionTree(self, inv, revision_id)
820
820
 
821
821
    @needs_read_lock
822
 
    def get_ancestry(self, revision_id):
 
822
    def get_ancestry(self, revision_id, topo_sorted=True):
823
823
        """Return a list of revision-ids integrated by a revision.
824
824
 
825
825
        The first element of the list is always None, indicating the origin 
834
834
        if not self.has_revision(revision_id):
835
835
            raise errors.NoSuchRevision(self, revision_id)
836
836
        w = self.get_inventory_weave()
837
 
        candidates = w.get_ancestry(revision_id)
 
837
        candidates = w.get_ancestry(revision_id, topo_sorted)
838
838
        return [None] + candidates # self._eliminate_revisions_not_present(candidates)
839
839
 
840
840
    @needs_read_lock