~ubuntu-branches/ubuntu/lucid/bzr/lucid-proposed

« back to all changes in this revision

Viewing changes to bzrlib/log.py

  • Committer: Bazaar Package Importer
  • Author(s): Jeff Bailey
  • Date: 2006-03-20 08:31:00 UTC
  • mfrom: (1.1.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060320083100-ovdi2ssuw0epcx8s
Tags: 0.8~200603200831-0ubuntu1
* Snapshot uploaded to Dapper at Martin Pool's request.

* Disable testsuite for upload.  Fakeroot and the testsuite don't
  play along.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    last_path = None
75
75
    revno = 1
76
76
    for revision_id in branch.revision_history():
77
 
        this_inv = branch.get_revision_inventory(revision_id)
 
77
        this_inv = branch.repository.get_revision_inventory(revision_id)
78
78
        if file_id in this_inv:
79
79
            this_ie = this_inv[file_id]
80
80
            this_path = this_inv.id2path(file_id)
223
223
            # although we calculated it, throw it away without display
224
224
            delta = None
225
225
 
226
 
        rev = branch.get_revision(rev_id)
 
226
        rev = branch.repository.get_revision(rev_id)
227
227
 
228
228
        if searchRE:
229
229
            if not searchRE.search(rev.message):
235
235
                excludes = set()
236
236
            else:
237
237
                # revno is 1 based, so -2 to get back 1 less.
238
 
                excludes = set(branch.get_ancestry(revision_history[revno - 2]))
 
238
                repository = branch.repository
 
239
                excludes = repository.get_ancestry(revision_history[revno - 2])
 
240
                excludes = set(excludes)
239
241
            pending = list(rev.parent_ids)
240
242
            while pending:
241
243
                rev_id = pending.pop()
244
246
                # prevent showing merged revs twice if they multi-path.
245
247
                excludes.add(rev_id)
246
248
                try:
247
 
                    rev = branch.get_revision(rev_id)
 
249
                    rev = branch.repository.get_revision(rev_id)
248
250
                except errors.NoSuchRevision:
249
251
                    continue
250
252
                pending.extend(rev.parent_ids)
448
450
    lf = LineLogFormatter(None)
449
451
    return lf.log_string(rev, max_chars)
450
452
 
451
 
FORMATTERS = {'long': LongLogFormatter,
 
453
FORMATTERS = {
 
454
              'long': LongLogFormatter,
452
455
              'short': ShortLogFormatter,
453
456
              'line': LineLogFormatter,
454
457
              }
455
458
 
 
459
def register_formatter(name, formatter):
 
460
    FORMATTERS[name] = formatter
456
461
 
457
462
def log_formatter(name, *args, **kwargs):
458
463
    """Construct a formatter from arguments.
463
468
    from bzrlib.errors import BzrCommandError
464
469
    try:
465
470
        return FORMATTERS[name](*args, **kwargs)
466
 
    except IndexError:
 
471
    except KeyError:
467
472
        raise BzrCommandError("unknown log formatter: %r" % name)
468
473
 
469
474
def show_one_log(revno, rev, delta, verbose, to_file, show_timezone):
510
515
        to_file.write('*'*60)
511
516
        to_file.write('\nRemoved Revisions:\n')
512
517
        for i in range(base_idx, len(old_rh)):
513
 
            rev = branch.get_revision(old_rh[i])
 
518
            rev = branch.repository.get_revision(old_rh[i])
514
519
            lf.show(i+1, rev, None)
515
520
        to_file.write('*'*60)
516
521
        to_file.write('\n\n')