Part of bzrlib.log View In Hierarchy
Known subclasses: bzrlib.log.GnuChangelogLogFormatter, bzrlib.log.LineLogFormatter, bzrlib.log.LongLogFormatter, bzrlib.log.ShortLogFormatter, bzrlib.tests.test_log.LogCatcher
Abstract class to display log messages.
At a minimum, a derived class must implement the log_revision method.
If the LogFormatter needs to be informed of the beginning or end of a log it should implement the begin_log and/or end_log hook methods.
A LogFormatter should define the following supports_XXX flags to indicate which LogRevision attributes it supports:
Plugins can register functions to show custom revision properties using the properties_handler_registry. The registered function must respect the following interface description:
def my_show_properties(properties_dict): # code that returns a dict {'name':'value'} of the properties # to be shown
Method | __init__ | Create a LogFormatter. |
Method | get_levels | Get the number of levels to display or 0 for all. |
Method | log_revision | Log a revision. |
Method | show_advice | Output user advice, if any, when the log is completed. |
Method | get_advice_separator | Get the text separating the log from the closing advice. |
Method | short_committer | Undocumented |
Method | short_author | Undocumented |
Method | authors | Generate list of authors, taking --authors option into account. |
Method | merge_marker | Get the merge marker to include in the output or '' if none. |
Method | show_properties | Displays the custom properties returned by each registered handler. |
Method | custom_properties | Format the custom properties returned by each registered handler. |
Method | show_diff | Undocumented |
Method | _foreign_info_properties | Custom log displayer for foreign revision identifiers. |
Method | _format_properties | Undocumented |
Parameters | to_file | the file to output to |
to_exact_file | if set, gives an output stream to which non-Unicode diffs are written. | |
show_ids | if True, revision-ids are to be displayed | |
show_timezone | the timezone to use | |
delta_format | the level of delta information to display or None to leave it to the formatter to decide | |
levels | the number of levels to display; None or -1 to let the log formatter decide. | |
show_advice | whether to show advice at the end of the log or not | |
author_list_handler | callable generating a list of authors to display for a given revision |
Parameters | revision | The LogRevision to be logged. |
The caller has to specify the name of a author list handler, as provided by the author list registry, using the who argument. That name only sets a default, though: when the user selected a different author list generation using the --authors command line switch, as represented by the author_list_handler constructor argument, that value takes precedence.
Parameters | rev | The revision for which to generate the list of authors. |
who | Name of the default handler. | |
short | Whether to shorten names to either name or address. | |
sep | What separator to use for automatic concatenation. |
If a registered handler raises an error it is propagated.
If a registered handler raises an error it is propagated.
Returns | a list of formatted lines (excluding trailing newlines) |