b.l.LogFormatter(object) : class documentation

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
def __init__(self, to_file, show_ids=False, show_timezone='original', delta_format=None, levels=None, show_advice=False, to_exact_file=None, author_list_handler=None):
Create a LogFormatter.
Parametersto_filethe file to output to
to_exact_fileif set, gives an output stream to which non-Unicode diffs are written.
show_idsif True, revision-ids are to be displayed
show_timezonethe timezone to use
delta_formatthe level of delta information to display or None to leave it to the formatter to decide
levelsthe number of levels to display; None or -1 to let the log formatter decide.
show_advicewhether to show advice at the end of the log or not
author_list_handlercallable generating a list of authors to display for a given revision
def get_levels(self):
Get the number of levels to display or 0 for all.
def log_revision(self, revision):
Log a revision.
ParametersrevisionThe LogRevision to be logged.
def show_advice(self):
Output user advice, if any, when the log is completed.
def get_advice_separator(self):
Get the text separating the log from the closing advice.
def short_committer(self, rev):
Undocumented
def short_author(self, rev):
Undocumented
def authors(self, rev, who, short=False, sep=None):
Generate list of authors, taking --authors option into account.

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.

ParametersrevThe revision for which to generate the list of authors.
whoName of the default handler.
shortWhether to shorten names to either name or address.
sepWhat separator to use for automatic concatenation.
def merge_marker(self, revision):
Get the merge marker to include in the output or '' if none.
def show_properties(self, revision, indent):
Displays the custom properties returned by each registered handler.

If a registered handler raises an error it is propagated.

def custom_properties(self, revision):
Format the custom properties returned by each registered handler.

If a registered handler raises an error it is propagated.

Returnsa list of formatted lines (excluding trailing newlines)
def _foreign_info_properties(self, rev):
Custom log displayer for foreign revision identifiers.
ParametersrevRevision object.
def _format_properties(self, properties):
Undocumented
def show_diff(self, to_file, diff, indent):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.