Part of bzrlib
Various flavors of log can be produced:
Logs are actually written out through an abstract LogFormatter interface, which allows for different preferred formats. Plugins can register formats too.
Logs can be produced in either forward (oldest->newest) or reverse (newest->oldest) order.
Logs can be filtered to show only revisions matching a particular search string, or within a particular range of revisions. The range can be given as date/times, which are reduced to revisions before calling in here.
In verbose mode we show a summary of what changed in each particular revision. Note that this is the delta for changes in that revision relative to its left-most parent, not the delta relative to the last logged revision. So for example if you ask for a verbose log of changes touching hello.c you will get a list of those revisions also listing other things that were changed in the same revision, but not all the changes since the previous revision that touched hello.c.
Function | find_touching_revisions | Yield a description of revisions which affect the file_id. |
Function | show_log | Write out human-readable log of commits to this branch. |
Function | make_log_request_dict | Convenience function for making a logging request dictionary. |
Function | format_signature_validity | get the signature validity |
Class | LogGenerator | A generator of log revisions. |
Class | Logger | An object that generates, formats and displays a log. |
Function | make_log_rev_iterator | Create a revision iterator for log. |
Function | reverse_by_depth | Reverse revisions by depth. |
Class | LogRevision | A revision to be logged (by LogFormatter.log_revision). |
Class | LogFormatter | Abstract class to display log messages. |
Class | LongLogFormatter | No class docstring; 2/5 methods documented |
Class | ShortLogFormatter | Undocumented |
Class | LineLogFormatter | No class docstring; 1/6 methods documented |
Class | GnuChangelogLogFormatter | No class docstring; 1/1 methods documented |
Function | line_log | Undocumented |
Class | LogFormatterRegistry | Registry for log formatters |
Function | register_formatter | Undocumented |
Function | log_formatter | Construct a formatter from arguments. |
Function | author_list_all | Undocumented |
Function | author_list_first | Undocumented |
Function | author_list_committer | Undocumented |
Function | show_changed_revisions | Show the change in revision history comparing the old revision history to the new one. |
Function | get_history_change | Calculate the uncommon lefthand history between two revisions. |
Function | show_branch_change | Show the changes made to a branch. |
Function | show_flat_log | Show a simple log of the specified history. |
Function | _enumerate_history | Undocumented |
Function | _apply_log_request_defaults | Apply default values to a request dictionary. |
Class | _StartNotLinearAncestor | Raised when a start revision is not found walking left-hand history. |
Class | _DefaultLogGenerator | The default generator of log revisions. |
Function | _calc_view_revisions | Calculate the revisions to view. |
Function | _generate_one_revision | Undocumented |
Function | _generate_flat_revisions | Undocumented |
Function | _generate_all_revisions | Undocumented |
Function | _has_merges | Does a revision have multiple parents or not? |
Function | _compute_revno_str | Compute the revno string from a rev_id. |
Function | _is_obvious_ancestor | Is start_rev_id an obvious ancestor of end_rev_id? |
Function | _linear_view_revisions | Calculate a sequence of revisions to view, newest to oldest. |
Function | _graph_view_revisions | Calculate revisions to view including merges, newest to oldest. |
Function | _rebase_merge_depth | Adjust depths upwards so the top level is 0. |
Function | _make_search_filter | Create a filtered iterator of log_rev_iterator matching on a regex. |
Function | _filter_re | Undocumented |
Function | _match_filter | Undocumented |
Function | _match_any_filter | Undocumented |
Function | _make_delta_filter | Add revision deltas to a log iterator if needed. |
Function | _generate_deltas | Create deltas for each batch of revisions in log_rev_iterator. |
Function | _update_fileids | Update the set of file-ids to search based on file lifecycle events. |
Function | _make_revision_objects | Extract revision objects from the repository |
Function | _make_batch_filter | Group up a single large batch into smaller ones. |
Function | _get_revision_limits | Get and check revision limits. |
Function | _get_mainline_revs | Get the mainline revisions from the branch. |
Function | _filter_revisions_touching_file_id | Return the list of revision ids which touch a given file id. |
Function | _get_info_for_log_files | Find file-ids and kinds given a list of files and a revision range. |
Function | _get_kind_for_file_id | Return the kind of a file-id or None if it doesn't exist. |
Function | _bugs_properties_handler | Undocumented |
Each returned element is (revno, revision_id, description)
This is the list of revisions where the file is either added, modified, renamed or deleted.
TODO: Perhaps some way to limit this to only particular revisions, or to traverse a non-mainline set of revisions?
This function is being retained for backwards compatibility but should not be extended with new parameters. Use the new Logger class instead, eg. Logger(branch, rqst).show(lf), adding parameters to the make_log_request_dict function.
Parameters | lf | The LogFormatter object showing the output. |
specific_fileid | If not None, list only the commits affecting the specified file, rather than all commits. | |
verbose | If True show added/changed/deleted/renamed files. | |
direction | 'reverse' (default) is latest to earliest; 'forward' is earliest to latest. | |
start_revision | If not None, only show revisions >= start_revision | |
end_revision | If not None, only show revisions <= end_revision | |
search | If not None, only show revisions with matching commit messages | |
limit | If set, shows only 'limit' revisions, all revisions are shown if None or 0. | |
show_diff | If True, output a diff after each revision. | |
match | Dictionary of search lists to use when matching revision properties. |
Convenience function for making a logging request dictionary. Using this function may make code slightly safer by ensuring parameters have the correct names. It also provides a reference point for documenting the supported parameters. :param direction: 'reverse' (default) is latest to earliest; 'forward' is earliest to latest. :param specific_fileids: If not None, only include revisions affecting the specified files, rather than all revisions. :param start_revision: If not None, only generate revisions >= start_revision :param end_revision: If not None, only generate revisions <= end_revision :param limit: If set, generate only 'limit' revisions, all revisions are shown if None or 0. :param message_search: If not None, only include revisions with matching commit messages :param levels: the number of levels of revisions to generate; 1 for just the mainline; 0 for all levels, or None for a sensible default. :param generate_tags: If True, include tags for matched revisions. ` :param delta_type: Either 'full', 'partial' or None. 'full' means generate the complete delta - adds/deletes/modifies/etc; 'partial' means filter the delta using specific_fileids; None means do not generate any delta. :param diff_type: Either 'full', 'partial' or None. 'full' means generate the complete diff - adds/deletes/modifies/etc; 'partial' means filter the diff using specific_fileids; None means do not generate any diff. :param _match_using_deltas: a private parameter controlling the algorithm used for matching specific_fileids. This parameter may be removed in the future so bzrlib client code should NOT use it. :param exclude_common_ancestry: Whether -rX..Y should be interpreted as a range operator or as a graph difference. :param signature: show digital signature information :param match: Dictionary of list of search strings to use when filtering revisions. Keys can be 'message', 'author', 'committer', 'bugs' or the empty string to match any of the preceding properties. :param omit_merges: If True, commits with more than one parent are omitted.
Parameters | rev_id | revision id to validate |
repo | repository of revision | |
Returns | human readable string to print to log |
Returns | An iterator of (revision_id, dotted_revno, merge_depth) tuples OR a list of the same tuples. |
Returns | The revno string, or None if the revision is not in the supplied branch. |
Parameters | start_rev_id | the lower revision-id |
end_rev_id | the upper revision-id | |
exclude_common_ancestry | Whether the start_rev_id should be part of the iterated revisions. | |
Returns | An iterator of (revision_id, dotted_revno, merge_depth) tuples. | |
Raises | _StartNotLinearAncestor | if a start_rev_id is specified but is not found walking the left-hand history |
Parameters | branch | the branch |
start_rev_id | the lower revision-id | |
end_rev_id | the upper revision-id | |
rebase_initial_depth | should depths be rebased until a mainline revision is found? | |
Returns | An iterator of (revision_id, dotted_revno, merge_depth) tuples. |
Parameters | branch | The branch being logged. |
view_revisions | The revisions being viewed. | |
generate_delta | Whether to generate a delta for each revision. Permitted values are None, 'full' and 'partial'. | |
search | A user text search string. | |
file_ids | If non empty, only revisions matching one or more of the file-ids are to be kept. | |
direction | the direction in which view_revisions is sorted | |
Returns | An iterator over lists of ((rev_id, revno, merge_depth), rev, delta). |
Parameters | branch | The branch being logged. |
generate_delta | Whether to generate a delta for each revision. | |
match | A dictionary with properties as keys and lists of strings as values. To match, a revision may match any of the supplied strings within a single property but must match at least one string for each property. | |
log_rev_iterator | An input iterator containing all revisions that could be displayed, in lists. | |
Returns | An iterator over lists of ((rev_id, revno, merge_depth), rev, delta). |
Parameters | branch | The branch being logged. |
generate_delta | Whether to generate a delta for each revision. Permitted values are None, 'full' and 'partial'. | |
search | A user text search string. | |
log_rev_iterator | An input iterator containing all revisions that could be displayed, in lists. | |
fileids | If non empty, only revisions matching one or more of the file-ids are to be kept. | |
direction | the direction in which view_revisions is sorted | |
Returns | An iterator over lists of ((rev_id, revno, merge_depth), rev, delta). |
If we're only generating deltas for the sake of filtering against file-ids, we stop generating deltas once all file-ids reach the appropriate life-cycle point. If we're receiving data newest to oldest, then that life-cycle point is 'add', otherwise it's 'remove'.
Parameters | fileids | a set of fileids to update |
stop_on | either 'add' or 'remove' - take file-ids out of the fileids set once their add or remove entry is detected respectively |
Parameters | branch | The branch being logged. |
generate_delta | Whether to generate a delta for each revision. | |
search | A user text search string. | |
log_rev_iterator | An input iterator containing all revisions that could be displayed, in lists. | |
Returns | An iterator over lists of ((rev_id, revno, merge_depth), rev, delta). |
Parameters | branch | The branch being logged. |
generate_delta | Whether to generate a delta for each revision. | |
search | A user text search string. | |
log_rev_iterator | An input iterator containing all revisions that could be displayed, in lists. | |
Returns | An iterator over lists of ((rev_id, revno, merge_depth), rev, delta). |
Parameters | branch | The branch containing the revisions. |
start_revision | The first revision to be logged. For backwards compatibility this may be a mainline integer revno, but for merge revision support a RevisionInfo is expected. | |
end_revision | The last revision to be logged. For backwards compatibility this may be a mainline integer revno, but for merge revision support a RevisionInfo is expected. | |
Returns | (start_rev_id, end_rev_id) tuple. |
Generates the list of mainline revisions for the branch.
Parameters | branch | The branch containing the revisions. |
start_revision | The first revision to be logged. For backwards compatibility this may be a mainline integer revno, but for merge revision support a RevisionInfo is expected. | |
end_revision | The last revision to be logged. For backwards compatibility this may be a mainline integer revno, but for merge revision support a RevisionInfo is expected. | |
Returns | A (mainline_revs, rev_nos, start_rev_id, end_rev_id) tuple. |
The function filters view_revisions and returns a subset. This includes the revisions which directly change the file id, and the revisions which merge these changes. So if the revision graph is:
A-. |\ \ B C E |/ / D | |\| | F |/ G
And 'C' changes a file, then both C and D will be returned. F will not be returned even though it brings the changes to C into the branch starting with E. (Note that if we were using F as the tip instead of G, then we would see C, D, F.)
This will also be restricted based on a subset of the mainline.
Parameters | branch | The branch where we can get text revision information. |
file_id | Filter out revisions that do not touch file_id. | |
view_revisions | A list of (revision_id, dotted_revno, merge_depth) tuples. This is the list of revisions which will be filtered. It is assumed that view_revisions is in merge_sort order (i.e. newest revision first ). | |
include_merges | include merge revisions in the result or not | |
Returns | A list of (revision_id, dotted_revno, merge_depth) tuples. |
Revisions with a different depth are sorted as a group with the previous revision of that depth. There may be no topological justification for this, but it looks much nicer.
Construct a formatter from arguments.
Parameters | branch | The branch where the revisions exist |
old_rh | The old revision history | |
new_rh | The new revision history | |
to_file | A file to write the results to. If None, stdout will be used |
return old_history, new_history
Parameters | old_revision_id | The original revision id. |
new_revision_id | The new revision id. | |
repository | The repository to use for the calculation. |
Parameters | branch | The branch to show changes about. |
output | A file-like object to write changes to. | |
old_revno | The revno of the old tip. | |
old_revision_id | The revision_id of the old tip. |
Parameters | repository | The repository to retrieve revisions from. |
history | A list of revision_ids indicating the lefthand history. | |
last_revno | The revno of the last revision_id in the history. | |
lf | The log formatter to use. |
We search for files at the end of the range. If not found there, we try the start of the range.
Parameters | revisionspec_list | revision range as parsed on the command line |
file_list | the list of paths given on the command line; the first of these can be a branch location or a file path, the remainder must be file paths | |
add_cleanup | When the branch returned is read locked, an unlock call will be queued to the cleanup. | |
Returns | (branch, info_list, start_rev_info, end_rev_info) where info_list is a list of (relative_path, file_id, kind) tuples where kind is one of values 'directory', 'file', 'symlink', 'tree-reference'. branch will be read-locked. |