~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-08-17 18:18:18 UTC
  • mfrom: (4618.2.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090817181818-6ks7pxgiwpqvsd3l
(vila) Make selftest --parallel=fork work again

Show diffs side-by-side

added added

removed removed

Lines of Context:
1190
1190
        generator = _VFContentMapGenerator(self, [key])
1191
1191
        return generator._get_content(key)
1192
1192
 
1193
 
    def get_known_graph_ancestry(self, keys):
1194
 
        """Get a KnownGraph instance with the ancestry of keys."""
1195
 
        parent_map, missing_keys = self._index.find_ancestry(keys)
1196
 
        kg = _mod_graph.KnownGraph(parent_map)
1197
 
        return kg
1198
 
 
1199
1193
    def get_parent_map(self, keys):
1200
1194
        """Get a map of the graph parents of keys.
1201
1195
 
2566
2560
        except KeyError:
2567
2561
            raise RevisionNotPresent(key, self)
2568
2562
 
2569
 
    def find_ancestry(self, keys):
2570
 
        """See CombinedGraphIndex.find_ancestry()"""
2571
 
        prefixes = set(key[:-1] for key in keys)
2572
 
        self._load_prefixes(prefixes)
2573
 
        result = {}
2574
 
        parent_map = {}
2575
 
        missing_keys = set()
2576
 
        pending_keys = list(keys)
2577
 
        # This assumes that keys will not reference parents in a different
2578
 
        # prefix, which is accurate so far.
2579
 
        while pending_keys:
2580
 
            key = pending_keys.pop()
2581
 
            if key in parent_map:
2582
 
                continue
2583
 
            prefix = key[:-1]
2584
 
            try:
2585
 
                suffix_parents = self._kndx_cache[prefix][0][key[-1]][4]
2586
 
            except KeyError:
2587
 
                missing_keys.add(key)
2588
 
            else:
2589
 
                parent_keys = tuple([prefix + (suffix,)
2590
 
                                     for suffix in suffix_parents])
2591
 
                parent_map[key] = parent_keys
2592
 
                pending_keys.extend([p for p in parent_keys
2593
 
                                        if p not in parent_map])
2594
 
        return parent_map, missing_keys
2595
 
 
2596
2563
    def get_parent_map(self, keys):
2597
2564
        """Get a map of the parents of keys.
2598
2565
 
3082
3049
            options.append('no-eol')
3083
3050
        return options
3084
3051
 
3085
 
    def find_ancestry(self, keys):
3086
 
        """See CombinedGraphIndex.find_ancestry()"""
3087
 
        return self._graph_index.find_ancestry(keys, 0)
3088
 
 
3089
3052
    def get_parent_map(self, keys):
3090
3053
        """Get a map of the parents of keys.
3091
3054