Part of bzrlib._annotator_py View In Hierarchy
Method | __init__ | Create a new Annotator from a VersionedFile. |
Method | add_special_text | Add a specific text to the graph. |
Method | annotate | Return annotated fulltext for the given key. |
Method | annotate_flat | Determine the single-best-revision to source for each line. |
Method | _update_needed_children | Undocumented |
Method | _get_needed_keys | Determine the texts we need to get from the backing vf. |
Method | _get_needed_texts | Get the texts we need to properly annotate key. |
Method | _get_parent_annotations_and_matches | Get the list of annotations for the parent, and the matching lines. |
Method | _update_from_first_parent | Reannotate this text relative to its first parent. |
Method | _update_from_other_parents | Reannotate this text relative to a second (or more) parent. |
Method | _record_annotation | Undocumented |
Method | _annotate_one | Undocumented |
Method | _get_heads_provider | Undocumented |
Method | _resolve_annotation_tie | Undocumented |
Determine the texts we need to get from the backing vf. :return: (vf_keys_needed, ann_keys_needed) vf_keys_needed These are keys that we need to get from the vf ann_keys_needed Texts which we have in self._text_cache but we don't have annotations for. We need to yield these in the proper order so that we can get proper annotations.
Parameters | key | A Key that is present in self._vf |
Returns | Yield (this_key, text, num_lines) 'text' is an opaque object that just has to work with whatever matcher object we are using. Currently it is always 'lines' but future improvements may change this to a simple text string. |
Get the list of annotations for the parent, and the matching lines. :param text: The opaque value given by _get_needed_texts :param parent_key: The key for the parent text :return: (parent_annotations, matching_blocks) parent_annotations is a list as long as the number of lines in parent matching_blocks is a list of (parent_idx, text_idx, len) tuples indicating which lines match between the two texts
This is used to add a text which is not otherwise present in the versioned file. (eg. a WorkingTree injecting 'current:' into the graph to annotate the edited content.)
Parameters | key | The key to use to request this text be annotated |
parent_keys | The parents of this text | |
text | A string containing the content of the text |
Return annotated fulltext for the given key. :param key: A tuple defining the text to annotate :return: ([annotations], [lines]) annotations is a list of tuples of keys, one for each line in lines each key is a possible source for the given line. lines the text of "key" as a list of lines