~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: Martin
  • Date: 2011-04-15 21:22:57 UTC
  • mto: This revision was merged to the branch mainline in revision 5797.
  • Revision ID: gzlist@googlemail.com-20110415212257-jgtovwwp4be7egd9
Add release notes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
36
36
    )
37
37
from bzrlib.btree_index import BTreeBuilder
38
38
from bzrlib.lru_cache import LRUSizeCache
 
39
from bzrlib.repofmt import pack_repo
39
40
from bzrlib.tsort import topo_sort
40
41
from bzrlib.versionedfile import (
41
42
    adapter_registry,
1046
1047
        index = _GCGraphIndex(graph_index, lambda:True, parents=parents,
1047
1048
            add_callback=graph_index.add_nodes,
1048
1049
            inconsistency_fatal=inconsistency_fatal)
1049
 
        access = knit._DirectPackAccess({})
 
1050
        access = pack_repo._DirectPackAccess({})
1050
1051
        access.set_writer(writer, graph_index, (transport, 'newpack'))
1051
1052
        result = GroupCompressVersionedFiles(index, access, delta)
1052
1053
        result.stream = stream
1186
1187
            _unadded_refs = {}
1187
1188
        self._unadded_refs = _unadded_refs
1188
1189
        self._group_cache = LRUSizeCache(max_size=50*1024*1024)
1189
 
        self._fallback_vfs = []
 
1190
        self._immediate_fallback_vfs = []
1190
1191
 
1191
1192
    def without_fallbacks(self):
1192
1193
        """Return a clone of this object without any fallbacks configured."""
1266
1267
 
1267
1268
        :param a_versioned_files: A VersionedFiles object.
1268
1269
        """
1269
 
        self._fallback_vfs.append(a_versioned_files)
 
1270
        self._immediate_fallback_vfs.append(a_versioned_files)
1270
1271
 
1271
1272
    def annotate(self, key):
1272
1273
        """See VersionedFiles.annotate."""
1312
1313
        # KnitVersionedFiles.get_known_graph_ancestry, but they don't share
1313
1314
        # ancestry.
1314
1315
        parent_map, missing_keys = self._index.find_ancestry(keys)
1315
 
        for fallback in self._fallback_vfs:
 
1316
        for fallback in self._transitive_fallbacks():
1316
1317
            if not missing_keys:
1317
1318
                break
1318
1319
            (f_parent_map, f_missing_keys) = fallback._index.find_ancestry(
1342
1343
            and so on.
1343
1344
        """
1344
1345
        result = {}
1345
 
        sources = [self._index] + self._fallback_vfs
 
1346
        sources = [self._index] + self._immediate_fallback_vfs
1346
1347
        source_results = []
1347
1348
        missing = set(keys)
1348
1349
        for source in sources:
1449
1450
        parent_map = {}
1450
1451
        key_to_source_map = {}
1451
1452
        source_results = []
1452
 
        for source in self._fallback_vfs:
 
1453
        for source in self._immediate_fallback_vfs:
1453
1454
            if not missing:
1454
1455
                break
1455
1456
            source_parents = source.get_parent_map(missing)
1832
1833
        """See VersionedFiles.keys."""
1833
1834
        if 'evil' in debug.debug_flags:
1834
1835
            trace.mutter_callsite(2, "keys scales with size of history")
1835
 
        sources = [self._index] + self._fallback_vfs
 
1836
        sources = [self._index] + self._immediate_fallback_vfs
1836
1837
        result = set()
1837
1838
        for source in sources:
1838
1839
            result.update(source.keys())