/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Wouter van Heyst
  • Date: 2006-06-06 12:06:20 UTC
  • mfrom: (1740 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: larstiq@larstiq.dyndns.org-20060606120620-50066b0951e4ef7c
merge bzr.dev 1740

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
from cStringIO import StringIO
21
21
 
22
22
from bzrlib.tests import BzrTestBase, TestCaseWithTransport
23
 
from bzrlib.log import LogFormatter, show_log, LongLogFormatter, ShortLogFormatter
 
23
from bzrlib.log import (LogFormatter, show_log, LongLogFormatter,
 
24
                        ShortLogFormatter, LineLogFormatter)
24
25
from bzrlib.branch import Branch
25
26
from bzrlib.errors import InvalidRevisionNumber
26
27
 
 
28
 
27
29
class _LogEntry(object):
28
30
    # should probably move into bzrlib.log?
29
31
    pass
41
43
    def __init__(self):
42
44
        super(LogCatcher, self).__init__(to_file=None)
43
45
        self.logs = []
44
 
        
45
 
        
 
46
 
46
47
    def show(self, revno, rev, delta):
47
48
        le = _LogEntry()
48
49
        le.revno = revno
279
280
  a
280
281
''')
281
282
 
 
283
    def test_line_log(self):
 
284
        """Line log should show revno
 
285
        
 
286
        bug #5162
 
287
        """
 
288
        wt = self.make_branch_and_tree('.')
 
289
        b = wt.branch
 
290
        self.build_tree(['a'])
 
291
        wt.add('a')
 
292
        b.nick = 'test-line-log'
 
293
        wt.commit(message='add a', 
 
294
                  timestamp=1132711707, 
 
295
                  timezone=36000,
 
296
                  committer='Line-Log-Formatter Tester <test@line.log>')
 
297
        logfile = file('out.tmp', 'w+')
 
298
        formatter = LineLogFormatter(to_file=logfile)
 
299
        show_log(b, formatter)
 
300
        logfile.flush()
 
301
        logfile.seek(0)
 
302
        log_contents = logfile.read()
 
303
        self.assertEqualDiff(log_contents, '1: Line-Log-Formatte... 2005-11-23 add a\n')