~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_log.py

  • Committer: Aaron Bentley
  • Date: 2007-08-20 13:07:12 UTC
  • mfrom: (2732 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2733.
  • Revision ID: abentley@panoramicfeedback.com-20070820130712-buopmg528zcgwyxc
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
428
428
  simple log message
429
429
""")
430
430
 
 
431
    def test_author_in_log(self):
 
432
        """Log includes the author name if it's set in
 
433
        the revision properties
 
434
        """
 
435
        wt = self.make_branch_and_tree('.')
 
436
        b = wt.branch
 
437
        self.build_tree(['a'])
 
438
        wt.add('a')
 
439
        b.nick = 'test_author_log'
 
440
        wt.commit(message='add a',
 
441
                  timestamp=1132711707,
 
442
                  timezone=36000,
 
443
                  committer='Lorem Ipsum <test@example.com>',
 
444
                  author='John Doe <jdoe@example.com>')
 
445
        sio = StringIO()
 
446
        formatter = LongLogFormatter(to_file=sio)
 
447
        show_log(b, formatter)
 
448
        self.assertEqualDiff(sio.getvalue(), '''\
 
449
------------------------------------------------------------
 
450
revno: 1
 
451
committer: Lorem Ipsum <test@example.com>
 
452
author: John Doe <jdoe@example.com>
 
453
branch nick: test_author_log
 
454
timestamp: Wed 2005-11-23 12:08:27 +1000
 
455
message:
 
456
  add a
 
457
''')
 
458
 
 
459
 
431
460
 
432
461
class TestLineLogFormatter(TestCaseWithTransport):
433
462
 
747
776
        tree = self.create_tree_with_single_merge()
748
777
        # f3 should be marked as modified by revisions A, B, C, and D
749
778
        self.assertAllRevisionsForFileID(tree, 'f2-id', ['D', 'C', 'A'])
 
779
 
 
780
 
 
781
class TestShowChangedRevisions(TestCaseWithTransport):
 
782
 
 
783
    def test_show_changed_revisions_verbose(self):
 
784
        tree = self.make_branch_and_tree('tree_a')
 
785
        self.build_tree(['tree_a/foo'])
 
786
        tree.add('foo')
 
787
        tree.commit('bar', rev_id='bar-id')
 
788
        s = StringIO()
 
789
        log.show_changed_revisions(tree.branch, [], ['bar-id'], s)
 
790
        self.assertContainsRe(s.getvalue(), 'bar')
 
791
        self.assertNotContainsRe(s.getvalue(), 'foo')