/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 breezy/tests/blackbox/test_log.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-24 00:39:50 UTC
  • mto: This revision was merged to the branch mainline in revision 7504.
  • Revision ID: jelmer@jelmer.uk-20200524003950-bbc545r76vc5yajg
Add github action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    test_log,
32
32
    features,
33
33
    )
 
34
from breezy.tests.matchers import ContainsNoVfsCalls
34
35
 
35
36
 
36
37
class TestLog(tests.TestCaseWithTransport, test_log.TestLogMixin):
299
300
        return builder
300
301
 
301
302
    def test_not_an_ancestor(self):
302
 
        self.assertRaises(errors.CommandError,
 
303
        self.assertRaises(errors.BzrCommandError,
303
304
                          log._generate_all_revisions,
304
305
                          self.branch, '1.1.1', '2.1.3', 'reverse',
305
306
                          delayed_graph_generation=True)
306
307
 
307
308
    def test_wrong_order(self):
308
 
        self.assertRaises(errors.CommandError,
 
309
        self.assertRaises(errors.BzrCommandError,
309
310
                          log._generate_all_revisions,
310
311
                          self.branch, '5', '2.1.3', 'reverse',
311
312
                          delayed_graph_generation=True)
902
903
        # Check logging a deleted file is ok if the file existed
903
904
        # at the start of the revision range
904
905
        self.prepare_tree(complex=True)
905
 
        self.assertLogRevnos(['file1'], [])
 
906
        self.assertLogRevnos(['file1'], ['1'])
906
907
 
907
908
    def test_log_file_renamed(self):
908
909
        """File matched against revision range, not current tree."""
1064
1065
        self.assertLogRevnos(["--match-author", "author"], ["2", "1"])
1065
1066
        self.assertLogRevnos(["--match-author", "author1",
1066
1067
                              "--match-author", "author2"], ["2", "1"])
 
1068
 
 
1069
 
 
1070
class TestSmartServerLog(tests.TestCaseWithTransport):
 
1071
 
 
1072
    def test_standard_log(self):
 
1073
        self.setup_smart_server_with_call_log()
 
1074
        t = self.make_branch_and_tree('branch')
 
1075
        self.build_tree_contents([('branch/foo', b'thecontents')])
 
1076
        t.add("foo")
 
1077
        t.commit("message")
 
1078
        self.reset_smart_call_log()
 
1079
        out, err = self.run_bzr(['log', self.get_url('branch')])
 
1080
        # This figure represent the amount of work to perform this use case. It
 
1081
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
1082
        # being too low. If rpc_count increases, more network roundtrips have
 
1083
        # become necessary for this use case. Please do not adjust this number
 
1084
        # upwards without agreement from bzr's network support maintainers.
 
1085
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
1086
        self.assertLength(1, self.hpss_connections)
 
1087
        self.assertLength(9, self.hpss_calls)
 
1088
 
 
1089
    def test_verbose_log(self):
 
1090
        self.setup_smart_server_with_call_log()
 
1091
        t = self.make_branch_and_tree('branch')
 
1092
        self.build_tree_contents([('branch/foo', b'thecontents')])
 
1093
        t.add("foo")
 
1094
        t.commit("message")
 
1095
        self.reset_smart_call_log()
 
1096
        out, err = self.run_bzr(['log', '-v', self.get_url('branch')])
 
1097
        # This figure represent the amount of work to perform this use case. It
 
1098
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
1099
        # being too low. If rpc_count increases, more network roundtrips have
 
1100
        # become necessary for this use case. Please do not adjust this number
 
1101
        # upwards without agreement from bzr's network support maintainers.
 
1102
        self.assertLength(10, self.hpss_calls)
 
1103
        self.assertLength(1, self.hpss_connections)
 
1104
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
1105
 
 
1106
    def test_per_file(self):
 
1107
        self.setup_smart_server_with_call_log()
 
1108
        t = self.make_branch_and_tree('branch')
 
1109
        self.build_tree_contents([('branch/foo', b'thecontents')])
 
1110
        t.add("foo")
 
1111
        t.commit("message")
 
1112
        self.reset_smart_call_log()
 
1113
        out, err = self.run_bzr(['log', '-v', self.get_url('branch') + "/foo"])
 
1114
        # This figure represent the amount of work to perform this use case. It
 
1115
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
1116
        # being too low. If rpc_count increases, more network roundtrips have
 
1117
        # become necessary for this use case. Please do not adjust this number
 
1118
        # upwards without agreement from bzr's network support maintainers.
 
1119
        self.assertLength(14, self.hpss_calls)
 
1120
        self.assertLength(1, self.hpss_connections)
 
1121
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)