~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.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:
124
124
    revisions_source is an object supporting a get_revision operation that
125
125
    behaves like Branch's.
126
126
    """
127
 
    return (candidate_id in branch.repository.get_ancestry(revision_id))
 
127
    return (candidate_id in branch.repository.get_ancestry(revision_id,
 
128
            topo_sorted=False))
128
129
 
129
130
 
130
131
def iter_ancestors(revision_id, revision_source, only_present=False):
258
259
                [revision_a, revision_b])
259
260
            # Shortcut the case where one of the tips is already included in
260
261
            # the other graphs ancestry.
261
 
            ancestry_a = graph.get_ancestry(revision_a)
 
262
            ancestry_a = graph.get_ancestry(revision_a, topo_sorted=False)
262
263
            if revision_b in ancestry_a:
263
264
                return revision_b
264
 
            ancestry_b = graph.get_ancestry(revision_b)
 
265
            ancestry_b = graph.get_ancestry(revision_b, topo_sorted=False)
265
266
            if revision_a in ancestry_b:
266
267
                return revision_a
267
268
            # convert to a NULL_REVISION based graph.