~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconcile.py

Make shure the faster topo_sort function is used where appropriate

When the calling code is iterating through the whole list, it is faster to use
topo_sort instead of TopoSorter.iter_topo_order.
Also update a blackbox test case to reflect the new ordering.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    repofmt,
34
34
    )
35
35
from bzrlib.trace import mutter, note
36
 
from bzrlib.tsort import TopoSorter
 
36
from bzrlib.tsort import topo_sort
37
37
from bzrlib.versionedfile import AdapterFactory, FulltextContentFactory
38
38
 
39
39
 
247
247
 
248
248
        # we have topological order of revisions and non ghost parents ready.
249
249
        self._setup_steps(len(self._rev_graph))
250
 
        revision_keys = [(rev_id,) for rev_id in
251
 
            TopoSorter(self._rev_graph.items()).iter_topo_order()]
 
250
        revision_keys = [(rev_id,) for rev_id in topo_sort(self._rev_graph)]
252
251
        stream = self._change_inv_parents(
253
252
            self.inventory.get_record_stream(revision_keys, 'unordered', True),
254
253
            self._new_inv_parents,
378
377
        new_inventories = self.repo._temp_inventories()
379
378
        # we have topological order of revisions and non ghost parents ready.
380
379
        graph = self.revisions.get_parent_map(self.revisions.keys())
381
 
        revision_keys = list(TopoSorter(graph).iter_topo_order())
 
380
        revision_keys = topo_sort(graph)
382
381
        revision_ids = [key[-1] for key in revision_keys]
383
382
        self._setup_steps(len(revision_keys))
384
383
        stream = self._change_inv_parents(