Module b.annotate

Part of bzrlib

File annotate based on weave storage
Line # Kind Name Docs
42 Function annotate_file Annotate file_id at revision rev_id in branch.
71 Function annotate_file_tree Annotate file_id in a tree.
240 Function reannotate Create a new annotated version from new lines and parent annotations.
107 Function _print_annotations Print annotations to to_file.
153 Function _show_id_annotations Undocumented
166 Function _annotations Return the list of (origin_revision_id, line_text) for a revision of a file in a repository.
173 Function _expand_annotations Expand a a files annotations into command line UI ready tuples.
291 Function _reannotate Undocumented
308 Function _get_matching_blocks Undocumented
314 Function _find_matching_unannotated_lines Find lines in plain_right_lines that match the existing lines.
375 Function _reannotate_annotated Update the annotations for a node based on another parent.
def annotate_file(branch, rev_id, file_id, verbose=False, full=False, to_file=None, show_ids=False):
Annotate file_id at revision rev_id in branch.

The branch should already be read_locked() when annotate_file is called.

ParametersbranchThe branch to look for revision numbers and history from.
rev_idThe revision id to annotate.
file_idThe file_id to annotate.
verboseShow all details rather than truncating to ensure reasonable text width.
fullXXXX Not sure what this does.
to_fileThe file to output the annotation to; if None stdout is used.
show_idsShow revision ids in the annotation output.
def annotate_file_tree(tree, file_id, to_file, verbose=False, full=False, show_ids=False):
Annotate file_id in a tree.

The tree should already be read_locked() when annotate_file_tree is called.

ParameterstreeThe tree to look for revision numbers and history from.
file_idThe file_id to annotate.
to_fileThe file to output the annotation to.
verboseShow all details rather than truncating to ensure reasonable text width.
fullXXXX Not sure what this does.
show_idsShow revision ids in the annotation output.
def _print_annotations(annotation, verbose, to_file, full):
Print annotations to to_file.
Parametersto_fileThe file to output the annotation to.
verboseShow all details rather than truncating to ensure reasonable text width.
fullXXXX Not sure what this does.
def _show_id_annotations(annotations, to_file, full):
Undocumented
def _annotations(repo, file_id, rev_id):
Return the list of (origin_revision_id, line_text) for a revision of a file in a repository.
def _expand_annotations(annotations, branch, current_rev=None):
Expand a a files annotations into command line UI ready tuples.

Each tuple includes detailed information, such as the author name, and date string for the commit, rather than just the revision id.

ParametersannotationsThe annotations to expand.
revision_id_to_revnoA map from id to revision numbers.
branchA locked branch to query for revision details.
def reannotate(parents_lines, new_lines, new_revision_id, _left_matching_blocks=None, heads_provider=None):
Create a new annotated version from new lines and parent annotations.
Parametersparents_linesList of annotated lines for all parents
new_linesThe un-annotated new lines
new_revision_idThe revision-id to associate with new lines (will often be CURRENT_REVISION)
left_matching_blocksa hint about which areas are common between the text and its left-hand-parent. The format is the SequenceMatcher.get_matching_blocks format (start_left, start_right, length_of_match).
heads_providerAn object which provids a .heads() call to resolve if any revision ids are children of others. If None, then any ancestry disputes will be resolved with new_revision_id
def _reannotate(parent_lines, new_lines, new_revision_id, matching_blocks=None):
Undocumented
def _get_matching_blocks(old, new):
Undocumented
def _find_matching_unannotated_lines(output_lines, plain_child_lines, child_lines, start_child, end_child, right_lines, start_right, end_right, heads_provider, revision_id):
Find lines in plain_right_lines that match the existing lines.
Parametersoutput_linesAppend final annotated lines to this list
plain_child_linesThe unannotated new lines for the child text
child_linesLines for the child text which have been annotated for the left parent
start_childPosition in plain_child_lines and child_lines to start the match searching
end_childLast position in plain_child_lines and child_lines to search for a match
right_linesThe annotated lines for the whole text for the right parent
start_rightPosition in right_lines to start the match
end_rightLast position in right_lines to search for a match
heads_providerWhen parents disagree on the lineage of a line, we need to check if one side supersedes the other
revision_idThe label to give if a line should be labeled 'tip'
def _reannotate_annotated(right_parent_lines, new_lines, new_revision_id, annotated_lines, heads_provider):
Update the annotations for a node based on another parent.
Parametersright_parent_linesA list of annotated lines for the right-hand parent.
new_linesThe unannotated new lines.
new_revision_idThe revision_id to attribute to lines which are not present in either parent.
annotated_linesA list of annotated lines. This should be the annotation of new_lines based on parents seen so far.
heads_providerWhen parents disagree on the lineage of a line, we need to check if one side supersedes the other.
API Documentation for BzrLib, generated by pydoctor at 2008-12-03 00:00:12.