~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: John Arbash Meinel
  • Date: 2007-05-24 11:54:07 UTC
  • mfrom: (2466.8.2 lf_rework)
  • mto: This revision was merged to the branch mainline in revision 2491.
  • Revision ID: john@arbash-meinel.com-20070524115407-lcnak713swd59lvk
[merge] Kent Gibson: Rework LogFormatter API

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib.tests import BzrTestBase, TestCaseWithTransport
22
22
from bzrlib.log import (show_log, 
23
23
                        get_view_revisions, 
 
24
                        LogRevision,
24
25
                        LogFormatter, 
25
26
                        LongLogFormatter, 
26
27
                        ShortLogFormatter, 
29
30
from bzrlib.errors import InvalidRevisionNumber
30
31
 
31
32
 
32
 
class _LogEntry(object):
33
 
    # should probably move into bzrlib.log?
34
 
    pass
35
 
 
36
 
 
37
33
class LogCatcher(LogFormatter):
38
34
    """Pull log messages into list rather than displaying them.
39
35
 
43
39
 
44
40
    We should also test the LogFormatter.
45
41
    """
 
42
 
 
43
    supports_delta = True 
 
44
 
46
45
    def __init__(self):
47
46
        super(LogCatcher, self).__init__(to_file=None)
48
47
        self.logs = []
49
48
 
50
 
    def show(self, revno, rev, delta):
51
 
        le = _LogEntry()
52
 
        le.revno = revno
53
 
        le.rev = rev
54
 
        le.delta = delta
55
 
        self.logs.append(le)
 
49
    def log_revision(self, revision):
 
50
        self.logs.append(revision)
56
51
 
57
52
 
58
53
class SimpleLogTest(TestCaseWithTransport):