~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-17 16:14:20 UTC
  • mto: This revision was merged to the branch mainline in revision 3785.
  • Revision ID: john@arbash-meinel.com-20081017161420-q7au1ngfvf2rwb4j
Two fixes for annotate code.

Restore the fast path when a branch is not stacked.
Handle when compression_parent is not the left-hand parent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2668
2668
                (rev_id, parent_ids, record) = nodes_to_annotate.pop()
2669
2669
                (index_memo, compression_parent, parents,
2670
2670
                 record_details) = self._all_build_details[rev_id]
 
2671
                blocks = None
2671
2672
                if compression_parent is not None:
2672
2673
                    comp_children = self._compression_children[compression_parent]
2673
2674
                    if rev_id not in comp_children:
2694
2695
                        copy_base_content=(not reuse_content))
2695
2696
                    fulltext = self._add_fulltext_content(rev_id,
2696
2697
                                                          fulltext_content)
2697
 
                    blocks = KnitContent.get_line_delta_blocks(delta,
2698
 
                            parent_fulltext, fulltext)
 
2698
                    if compression_parent == parent_ids[0]:
 
2699
                        # the compression_parent is the left parent, so we can
 
2700
                        # re-use the delta
 
2701
                        blocks = KnitContent.get_line_delta_blocks(delta,
 
2702
                                parent_fulltext, fulltext)
2699
2703
                else:
2700
2704
                    fulltext_content = self._knit._factory.parse_fulltext(
2701
2705
                        record, rev_id)
2702
2706
                    fulltext = self._add_fulltext_content(rev_id,
2703
2707
                        fulltext_content)
2704
 
                    blocks = None
2705
2708
                nodes_to_annotate.extend(
2706
2709
                    self._add_annotation(rev_id, fulltext, parent_ids,
2707
2710
                                     left_matching_blocks=blocks))
2722
2725
 
2723
2726
        :param key: The key to annotate.
2724
2727
        """
2725
 
        if True or len(self._knit._fallback_vfs) > 0:
 
2728
        if len(self._knit._fallback_vfs) > 0:
2726
2729
            # stacked knits can't use the fast path at present.
2727
2730
            return self._simple_annotate(key)
2728
2731
        records = self._get_build_graph(key)