~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-10 18:58:02 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-20090610185802-wsybzjfil447yhy2
Change VF.annotate to use the new KnownGraph code.

This shows a significant savings in the time for 'annotate NEWS', of about 5s/20s
for knit formats, and 45s => 20s for GC formats.


Also, factor the code into a helper, so that we can prepare for writing
a pyrex version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3552
3552
        """Create a heads provider for resolving ancestry issues."""
3553
3553
        if self._heads_provider is not None:
3554
3554
            return self._heads_provider
3555
 
        parent_provider = _mod_graph.DictParentsProvider(
3556
 
            self._revision_id_graph)
3557
 
        graph_obj = _mod_graph.Graph(parent_provider)
3558
 
        head_cache = _mod_graph.FrozenHeadsCache(graph_obj)
3559
 
        self._heads_provider = head_cache
3560
 
        return head_cache
 
3555
        # graph_obj = _mod_graph.Graph(parent_provider)
 
3556
        # head_cache = _mod_graph.FrozenHeadsCache(graph_obj)
 
3557
        self._heads_provider = _mod_graph.KnownGraph(self._revision_id_graph)
 
3558
        return self._heads_provider
3561
3559
 
3562
3560
    def annotate(self, key):
3563
3561
        """Return the annotated fulltext at the given key.