/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

merge bzr.dev r4054

Show diffs side-by-side

added added

removed removed

Lines of Context:
488
488
 
489
489
    def test_verbose_log(self):
490
490
        """Verbose log includes changed files
491
 
        
 
491
 
492
492
        bug #4676
493
493
        """
494
494
        wt = self.make_branch_and_tree('.')
696
696
                             sio.getvalue())
697
697
 
698
698
    def test_properties_in_log(self):
699
 
        """Log includes the custom properties returned by the registered 
 
699
        """Log includes the custom properties returned by the registered
700
700
        handlers.
701
701
        """
702
702
        wt = self.make_branch_and_tree('.')
735
735
''',
736
736
                                 sio.getvalue())
737
737
 
 
738
    def test_properties_in_short_log(self):
 
739
        """Log includes the custom properties returned by the registered
 
740
        handlers.
 
741
        """
 
742
        wt = self.make_branch_and_tree('.')
 
743
        b = wt.branch
 
744
        self.build_tree(['a'])
 
745
        wt.add('a')
 
746
        b.nick = 'test_properties_in_short_log'
 
747
        wt.commit(message='add a',
 
748
                  timestamp=1132711707,
 
749
                  timezone=36000,
 
750
                  committer='Lorem Ipsum <test@example.com>',
 
751
                  author='John Doe <jdoe@example.com>')
 
752
        sio = StringIO()
 
753
        formatter = log.ShortLogFormatter(to_file=sio)
 
754
        try:
 
755
            def trivial_custom_prop_handler(revision):
 
756
                return {'test_prop':'test_value'}
 
757
 
 
758
            log.properties_handler_registry.register(
 
759
                'trivial_custom_prop_handler',
 
760
                trivial_custom_prop_handler)
 
761
            log.show_log(b, formatter)
 
762
        finally:
 
763
            log.properties_handler_registry.remove(
 
764
                'trivial_custom_prop_handler')
 
765
            self.assertEqualDiff('''\
 
766
    1 John Doe\t2005-11-23
 
767
      test_prop: test_value
 
768
      add a
 
769
 
 
770
''',
 
771
                                 sio.getvalue())
 
772
 
738
773
    def test_error_in_properties_handler(self):
739
 
        """Log includes the custom properties returned by the registered 
 
774
        """Log includes the custom properties returned by the registered
740
775
        handlers.
741
776
        """
742
777
        wt = self.make_branch_and_tree('.')
802
837
 
803
838
    def test_long_verbose_log(self):
804
839
        """Verbose log includes changed files
805
 
        
 
840
 
806
841
        bug #4676
807
842
        """
808
843
        wt = self.make_branch_and_tree('.')
941
976
                             sio.getvalue())
942
977
 
943
978
    def test_long_properties_in_log(self):
944
 
        """Log includes the custom properties returned by the registered 
 
979
        """Log includes the custom properties returned by the registered
945
980
        handlers.
946
981
        """
947
982
        wt = self.make_branch_and_tree('.')
985
1020
 
986
1021
    def test_line_log(self):
987
1022
        """Line log should show revno
988
 
        
 
1023
 
989
1024
        bug #5162
990
1025
        """
991
1026
        wt = self.make_branch_and_tree('.')
1065
1100
        log.show_log(wt.branch, formatter)
1066
1101
        self.assertEqualDiff("""\
1067
1102
3: Jane Foo 2005-11-22 {v1.0, v1.0rc1} rev-3
1068
 
2: Joe Foo 2005-11-22 {v0.2} rev-2
 
1103
2: Joe Foo 2005-11-22 [merge] {v0.2} rev-2
1069
1104
1: Joe Foo 2005-11-22 rev-1
1070
1105
""",
1071
1106
                             logfile.getvalue())
1074
1109
 
1075
1110
    def test_line_merge_revs_log(self):
1076
1111
        """Line log should show revno
1077
 
        
 
1112
 
1078
1113
        bug #5162
1079
1114
        """
1080
1115
        wt = self.make_branch_and_tree('.')
1142
1177
        formatter = log.LineLogFormatter(to_file=logfile, levels=0)
1143
1178
        log.show_log(wt.branch, formatter)
1144
1179
        self.assertEqualDiff("""\
1145
 
2: Joe Foo 2005-11-22 rev-2
 
1180
2: Joe Foo 2005-11-22 [merge] rev-2
1146
1181
  1.1.1: Joe Foo 2005-11-22 rev-merged
1147
1182
1: Joe Foo 2005-11-22 rev-1
1148
1183
""",