~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

  • Committer: Aaron Bentley
  • Date: 2007-06-21 01:58:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2542.
  • Revision ID: aaron.bentley@utoronto.ca-20070621015829-b62l2d1ehuvgnr3x
Fix iter_topo_order to permit un-included parents

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
                return lca.pop()
279
279
            revisions = lca
280
280
 
281
 
    def iter_topo(self, revisions):
 
281
    def iter_topo_order(self, revisions):
282
282
        """Iterate through the input revisions in topological order.
283
283
 
284
284
        This sorting only ensures that parents come before their children.
285
285
        An ancestor may sort after a descendant if the relationship is not
286
286
        visible in the supplied list of revisions.
287
287
        """
288
 
        subgraph = zip(revisions, self.get_parents(revisions))
289
 
        subgraph = [(r, [p for p in ps if p in revisions])
290
 
                    for r, ps in subgraph]
291
 
        return tsort.topo_sort(subgraph)
 
288
        return tsort.topo_sort(zip(revisions, self.get_parents(revisions)))
292
289
 
293
290
 
294
291
class _BreadthFirstSearcher(object):