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)
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)
1064
1065
self.assertLogRevnos(["--match-author", "author"], ["2", "1"])
1065
1066
self.assertLogRevnos(["--match-author", "author1",
1066
1067
"--match-author", "author2"], ["2", "1"])
1070
class TestSmartServerLog(tests.TestCaseWithTransport):
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')])
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)
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')])
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)
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')])
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)