/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/groupcompress.py

  • Committer: Vincent Ladeuil
  • Date: 2009-05-25 19:04:59 UTC
  • mto: (4381.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 4382.
  • Revision ID: v.ladeuil+lp@free.fr-20090525190459-ke7qqcbngcg3kcsz
Start fixing annotate for gc.

* bzrlib/repofmt/groupcompress_repo.py:
(GCPack.__init__): Mention that code and comment disagree.

* bzrlib/knit.py: 
Fix typo.

* bzrlib/groupcompress.py:
(GroupCompressVersionedFiles.annotate): Reuse the graph we already
acquired from reading the index.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1018
1018
        else:
1019
1019
            keys = [key]
1020
1020
            parent_map = {key:()}
 
1021
        # So we used Graph(self) to load the parent_map, but now that we have
 
1022
        # it, we can just query the parent map directly, so create a new Graph
 
1023
        # object
 
1024
        graph = _mod_graph.Graph(_mod_graph.DictParentsProvider(parent_map))
1021
1025
        head_cache = _mod_graph.FrozenHeadsCache(graph)
1022
1026
        parent_cache = {}
1023
1027
        reannotate = annotate.reannotate
1024
1028
        for record in self.get_record_stream(keys, 'topological', True):
1025
1029
            key = record.key
1026
 
            chunks = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
 
1030
            lines = osutils.chunks_to_lines(record.get_bytes_as('chunked'))
1027
1031
            parent_lines = [parent_cache[parent] for parent in parent_map[key]]
1028
1032
            parent_cache[key] = list(
1029
 
                reannotate(parent_lines, chunks, key, None, head_cache))
 
1033
                reannotate(parent_lines, lines, key, None, head_cache))
1030
1034
        return parent_cache[key]
1031
1035
 
1032
1036
    def check(self, progress_bar=None):