~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
except ImportError:
24
24
    pylzma = None
25
25
 
 
26
from bzrlib.lazy_import import lazy_import
 
27
lazy_import(globals(), """
26
28
from bzrlib import (
27
29
    annotate,
28
30
    debug,
29
31
    errors,
30
32
    graph as _mod_graph,
31
 
    knit,
32
33
    osutils,
33
34
    pack,
34
35
    static_tuple,
35
36
    trace,
 
37
    tsort,
36
38
    )
 
39
 
 
40
from bzrlib.repofmt import pack_repo
 
41
""")
 
42
 
37
43
from bzrlib.btree_index import BTreeBuilder
38
44
from bzrlib.lru_cache import LRUSizeCache
39
 
from bzrlib.tsort import topo_sort
40
45
from bzrlib.versionedfile import (
 
46
    _KeyRefs,
41
47
    adapter_registry,
42
48
    AbsentContentFactory,
43
49
    ChunkedContentFactory,
77
83
 
78
84
    present_keys = []
79
85
    for prefix in sorted(per_prefix_map):
80
 
        present_keys.extend(reversed(topo_sort(per_prefix_map[prefix])))
 
86
        present_keys.extend(reversed(tsort.topo_sort(per_prefix_map[prefix])))
81
87
    return present_keys
82
88
 
83
89
 
1046
1052
        index = _GCGraphIndex(graph_index, lambda:True, parents=parents,
1047
1053
            add_callback=graph_index.add_nodes,
1048
1054
            inconsistency_fatal=inconsistency_fatal)
1049
 
        access = knit._DirectPackAccess({})
 
1055
        access = pack_repo._DirectPackAccess({})
1050
1056
        access.set_writer(writer, graph_index, (transport, 'newpack'))
1051
1057
        result = GroupCompressVersionedFiles(index, access, delta)
1052
1058
        result.stream = stream
1470
1476
            the defined order, regardless of source.
1471
1477
        """
1472
1478
        if ordering == 'topological':
1473
 
            present_keys = topo_sort(parent_map)
 
1479
            present_keys = tsort.topo_sort(parent_map)
1474
1480
        else:
1475
1481
            # ordering == 'groupcompress'
1476
1482
            # XXX: This only optimizes for the target ordering. We may need
1921
1927
        # repeated over and over, this creates a surplus of ints
1922
1928
        self._int_cache = {}
1923
1929
        if track_external_parent_refs:
1924
 
            self._key_dependencies = knit._KeyRefs(
 
1930
            self._key_dependencies = _KeyRefs(
1925
1931
                track_new_keys=track_new_keys)
1926
1932
        else:
1927
1933
            self._key_dependencies = None