~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

[merge] bzr.log.plugins: add --log-format to 'bzr log', allow a default to be set in config

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
    lf = LineLogFormatter(None)
451
451
    return lf.log_string(rev, max_chars)
452
452
 
453
 
FORMATTERS = {'long': LongLogFormatter,
 
453
FORMATTERS = {
 
454
              'long': LongLogFormatter,
454
455
              'short': ShortLogFormatter,
455
456
              'line': LineLogFormatter,
456
457
              }
457
458
 
 
459
def register_formatter(name, formatter):
 
460
    FORMATTERS[name] = formatter
458
461
 
459
462
def log_formatter(name, *args, **kwargs):
460
463
    """Construct a formatter from arguments.
465
468
    from bzrlib.errors import BzrCommandError
466
469
    try:
467
470
        return FORMATTERS[name](*args, **kwargs)
468
 
    except IndexError:
 
471
    except KeyError:
469
472
        raise BzrCommandError("unknown log formatter: %r" % name)
470
473
 
471
474
def show_one_log(revno, rev, delta, verbose, to_file, show_timezone):