~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-02-18 02:33:47 UTC
  • mfrom: (1534.1.24 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060218023347-0952c65f668bfd68
Merge Robert Collins integration.

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