b.annotate : module documentation

Part of bzrlib

File annotate based on weave storage
Function annotate_file Annotate file_id at revision rev_id in branch.
Function annotate_file_tree Annotate file_id in a tree.
Function reannotate Create a new annotated version from new lines and parent annotations.
Function _print_annotations Print annotations to to_file.
Function _show_id_annotations Undocumented
Function _expand_annotations Expand a file's annotations into command line UI ready tuples.
Function _reannotate Undocumented
Function _get_matching_blocks Undocumented
Function _old_break_annotation_tie Chose an attribution between several possible ones.
Function _find_matching_unannotated_lines Find lines in plain_right_lines that match the existing lines.
Function _reannotate_annotated Update the annotations for a node based on another parent.
@deprecated_function(deprecated_in((2, 4, 0)))
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, branch=None):
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.
branchBranch to use for revision revno lookups
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 _expand_annotations(annotations, branch, current_rev=None):
Expand a file's 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 provides 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 _old_break_annotation_tie(annotated_lines):
Chose an attribution between several possible ones.
Parametersannotated_lines
A list of tuples ((file_id, rev_id), line) where
the lines are identical but the revids different while no parent relation exist between them
:return : The "winning" line. This must be one with a revid that
guarantees that further criss-cross merges will converge. Failing to do so have performance implications.
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 Bazaar, generated by pydoctor at 2019-05-25 00:21:58.