~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Andrew Bennetts
  • Date: 2008-02-18 08:30:38 UTC
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080218083038-tts55zsx5xrz3l2e
Lots of assorted hackery to reduce the number of imports for common operations.  Improves 'rocks', 'st' and 'help' times by ~50ms on my laptop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
import time
76
76
import warnings
77
77
 
 
78
from bzrlib.lazy_import import lazy_import
 
79
lazy_import(globals(), """
 
80
from bzrlib import tsort
 
81
""")
78
82
from bzrlib import (
79
83
    progress,
80
84
    )
88
92
import bzrlib.errors as errors
89
93
from bzrlib.osutils import sha_strings
90
94
import bzrlib.patiencediff
91
 
from bzrlib.tsort import topo_sort
92
95
from bzrlib.versionedfile import VersionedFile, InterVersionedFile
93
96
from bzrlib.weavefile import _read_weave_v5, write_weave_v5
94
97
 
760
763
        version_ids = other.get_ancestry(version_ids)
761
764
        pending_graph = [(version, other.get_parents(version)) for
762
765
                         version in version_ids]
763
 
        for name in topo_sort(pending_graph):
 
766
        for name in tsort.topo_sort(pending_graph):
764
767
            other_idx = other._name_map[name]
765
768
            # returns True if we have it, False if we need it.
766
769
            if not self._check_version_consistent(other, other_idx, name):
940
943
    # map from version name -> all parent names
941
944
    combined_parents = _reweave_parent_graphs(wa, wb)
942
945
    mutter("combined parents: %r", combined_parents)
943
 
    order = topo_sort(combined_parents.iteritems())
 
946
    order = tsort.topo_sort(combined_parents.iteritems())
944
947
    mutter("order to reweave: %r", order)
945
948
 
946
949
    if pb and not msg: