~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

Merge tarball branch that's already with PQM, resolving conflicts.

Show diffs side-by-side

added added

removed removed

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