~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

Merge pt1 hooks branch.

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
1186
1186
            _unadded_refs = {}
1187
1187
        self._unadded_refs = _unadded_refs
1188
1188
        self._group_cache = LRUSizeCache(max_size=50*1024*1024)
1189
 
        self._fallback_vfs = []
 
1189
        self._immediate_fallback_vfs = []
1190
1190
 
1191
1191
    def without_fallbacks(self):
1192
1192
        """Return a clone of this object without any fallbacks configured."""
1266
1266
 
1267
1267
        :param a_versioned_files: A VersionedFiles object.
1268
1268
        """
1269
 
        self._fallback_vfs.append(a_versioned_files)
 
1269
        self._immediate_fallback_vfs.append(a_versioned_files)
1270
1270
 
1271
1271
    def annotate(self, key):
1272
1272
        """See VersionedFiles.annotate."""
1312
1312
        # KnitVersionedFiles.get_known_graph_ancestry, but they don't share
1313
1313
        # ancestry.
1314
1314
        parent_map, missing_keys = self._index.find_ancestry(keys)
1315
 
        for fallback in self._fallback_vfs:
 
1315
        for fallback in self._transitive_fallbacks():
1316
1316
            if not missing_keys:
1317
1317
                break
1318
1318
            (f_parent_map, f_missing_keys) = fallback._index.find_ancestry(
1342
1342
            and so on.
1343
1343
        """
1344
1344
        result = {}
1345
 
        sources = [self._index] + self._fallback_vfs
 
1345
        sources = [self._index] + self._immediate_fallback_vfs
1346
1346
        source_results = []
1347
1347
        missing = set(keys)
1348
1348
        for source in sources:
1449
1449
        parent_map = {}
1450
1450
        key_to_source_map = {}
1451
1451
        source_results = []
1452
 
        for source in self._fallback_vfs:
 
1452
        for source in self._immediate_fallback_vfs:
1453
1453
            if not missing:
1454
1454
                break
1455
1455
            source_parents = source.get_parent_map(missing)
1832
1832
        """See VersionedFiles.keys."""
1833
1833
        if 'evil' in debug.debug_flags:
1834
1834
            trace.mutter_callsite(2, "keys scales with size of history")
1835
 
        sources = [self._index] + self._fallback_vfs
 
1835
        sources = [self._index] + self._immediate_fallback_vfs
1836
1836
        result = set()
1837
1837
        for source in sources:
1838
1838
            result.update(source.keys())