/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/graph.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:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
from bzrlib import errors
 
17
from bzrlib import (
 
18
    errors,
 
19
    tsort,
 
20
    )
18
21
from bzrlib.deprecated_graph import (node_distances, select_farthest)
19
22
from bzrlib.revision import NULL_REVISION
20
23
 
275
278
                return lca.pop()
276
279
            revisions = lca
277
280
 
 
281
    def iter_topo_order(self, revisions):
 
282
        """Iterate through the input revisions in topological order.
 
283
 
 
284
        This sorting only ensures that parents come before their children.
 
285
        An ancestor may sort after a descendant if the relationship is not
 
286
        visible in the supplied list of revisions.
 
287
        """
 
288
        return tsort.topo_sort(zip(revisions, self.get_parents(revisions)))
 
289
 
278
290
 
279
291
class _BreadthFirstSearcher(object):
280
292
    """Parallel search the breadth-first the ancestry of revisions.