/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2008-07-01 03:49:54 UTC
  • mto: This revision was merged to the branch mainline in revision 3515.
  • Revision ID: robertc@robertcollins.net-20080701034954-5r0c28cocphgv6td
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1007
1007
                if record.storage_kind == 'absent':
1008
1008
                    continue
1009
1009
                missing_keys.remove(record.key)
1010
 
                bytes = record.get_bytes_as('fulltext')
1011
1010
                lines = split_lines(record.get_bytes_as('fulltext'))
1012
1011
                text_map[record.key] = lines
1013
1012
                content_map[record.key] = PlainKnitContent(lines, record.key)
1065
1064
        :return: A mapping from keys to parents. Absent keys are absent from
1066
1065
            the mapping.
1067
1066
        """
1068
 
        return self._get_parent_map(keys)[0]
 
1067
        return self._get_parent_map_with_sources(keys)[0]
1069
1068
 
1070
 
    def _get_parent_map(self, keys):
 
1069
    def _get_parent_map_with_sources(self, keys):
1071
1070
        """Get a map of the parents of keys.
1072
1071
 
1073
1072
        :param keys: The keys to look up parents for.
1179
1178
                if not result:
1180
1179
                    needed_from_fallback.add(key)
1181
1180
        # Double index lookups here : need a unified api ?
1182
 
        global_map, parent_maps = self._get_parent_map(keys)
 
1181
        global_map, parent_maps = self._get_parent_map_with_sources(keys)
1183
1182
        if ordering == 'topological':
1184
1183
            # Global topological sort
1185
1184
            present_keys = topo_sort(global_map)
1208
1207
        for key in absent_keys:
1209
1208
            yield AbsentContentFactory(key)
1210
1209
        # restrict our view to the keys we can answer.
1211
 
        our_keys = parent_maps[0]
1212
 
        # keys - needed_from_fallback
1213
 
        # keys = keys - absent_keys
1214
1210
        # XXX: Memory: TODO: batch data here to cap buffered data at (say) 1MB.
1215
1211
        # XXX: At that point we need to consider the impact of double reads by
1216
1212
        # utilising components multiple times.