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

  • Committer: John Arbash Meinel
  • Date: 2009-07-08 15:20:14 UTC
  • mto: This revision was merged to the branch mainline in revision 4522.
  • Revision ID: john@arbash-meinel.com-20090708152014-7effsnpiore2yyy4
inherit from _annotator_py.Annotator in _annotator_pyx.Annotator.

This removes some of the redundancy between implemenations. No visible performance
impact. \o/.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        self._num_needed_children = {}
38
38
        self._annotations_cache = {}
39
39
        self._heads_provider = None
 
40
        self._ann_tuple_cache = {}
40
41
 
41
42
    def _update_needed_children(self, key, parent_keys):
42
43
        for parent_key in parent_keys:
140
141
        matching_blocks = matcher.get_matching_blocks()
141
142
        return parent_annotations, matching_blocks
142
143
 
143
 
    def _update_from_one_parent(self, key, annotations, lines, parent_key):
 
144
    def _update_from_first_parent(self, key, annotations, lines, parent_key):
144
145
        """Reannotate this text relative to its first parent."""
145
146
        parent_annotations, matching_blocks = self._get_parent_annotations_and_matches(
146
147
            key, lines, parent_key)
215
216
        annotations = [this_annotation] * num_lines
216
217
        parent_keys = self._parent_map[key]
217
218
        if parent_keys:
218
 
            self._update_from_one_parent(key, annotations, text, parent_keys[0])
 
219
            self._update_from_first_parent(key, annotations, text,
 
220
                                           parent_keys[0])
219
221
            for parent in parent_keys[1:]:
220
222
                self._update_from_other_parents(key, annotations, text,
221
223
                                                this_annotation, parent)
262
264
            else:
263
265
                the_heads = heads(annotation)
264
266
                if len(the_heads) == 1:
265
 
                    for head in the_heads:
266
 
                        break
 
267
                    for head in the_heads: break # get the item out of the set
267
268
                else:
268
269
                    # We need to resolve the ambiguity, for now just pick the
269
270
                    # sorted smallest