~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Martin Pool
  • Date: 2006-03-06 11:20:10 UTC
  • mfrom: (1593 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060306112010-17c0170dde5d1eea
[merge] large merge to sync with bzr.dev

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):