~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-11 20:34:56 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090611203456-g3z9360rdd00tjs3
Clean up the annotate code while using the new functionality.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1028
1028
        else:
1029
1029
            keys = [key]
1030
1030
            parent_map = {key:()}
1031
 
        # So we used Graph(self) to load the parent_map, but now that we have
1032
 
        # it, we can just query the parent map directly, so create a new Graph
1033
 
        # object
1034
 
        graph = _mod_graph.KnownGraph(parent_map)
 
1031
        # We used Graph(self) to load the parent_map, but now that we have it,
 
1032
        # we can just query the parent map directly, so create a KnownGraph
 
1033
        heads_provider = _mod_graph.KnownGraph(parent_map)
1035
1034
        parent_cache = {}
1036
1035
        reannotate = annotate.reannotate
1037
1036
        for record in self.get_record_stream(keys, 'topological', True):
1039
1038
            lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
1040
1039
            parent_lines = [parent_cache[parent] for parent in parent_map[key]]
1041
1040
            parent_cache[key] = list(
1042
 
                reannotate(parent_lines, lines, key, None, graph))
 
1041
                reannotate(parent_lines, lines, key, None, heads_provider))
1043
1042
        return parent_cache[key]
1044
1043
 
1045
1044
    def check(self, progress_bar=None):