159
158
self.make_linear_branch()
160
159
self.assertLogRevnos(['-c1'], ['1'])
162
def test_branch_revspec(self):
163
foo = self.make_branch_and_tree('foo')
164
bar = self.make_branch_and_tree('bar')
165
self.build_tree(['foo/foo.txt', 'bar/bar.txt'])
168
foo.commit(message='foo')
169
bar.commit(message='bar')
170
self.run_bzr('log -r branch:../bar', working_dir='foo')
171
self.assertEqual([bar.branch.get_rev_id(1)],
173
for r in self.get_captured_revisions()])
176
class TestLogExcludeCommonAncestry(TestLogWithLogCatcher):
178
def test_exclude_common_ancestry_simple_revnos(self):
179
self.make_linear_branch()
180
self.assertLogRevnos(['-r1..3', '--exclude-common-ancestry'],
184
162
class TestLogMergedLinearAncestry(TestLogWithLogCatcher):
947
893
self.prepare_tree()
949
895
self.assertLogRevnos(['dir2', 'file5'], ['5', '3'])
952
class MainlineGhostTests(TestLogWithLogCatcher):
955
super(MainlineGhostTests, self).setUp()
956
tree = self.make_branch_and_tree('')
957
tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
959
tree.commit('msg1', rev_id='rev1')
960
tree.commit('msg2', rev_id='rev2')
962
def test_log_range(self):
963
self.assertLogRevnos(["-r1..2"], ["2", "1"])
965
def test_log_norange(self):
966
self.assertLogRevnos([], ["2", "1"])
968
def test_log_range_open_begin(self):
969
self.knownFailure("log with ghosts fails. bug #726466")
970
(stdout, stderr) = self.run_bzr(['log', '-r..2'], retcode=3)
971
self.assertEqual(["2", "1"],
972
[r.revno for r in self.get_captured_revisions()])
973
self.assertEquals("bzr: ERROR: Further revision history missing.", stderr)
975
def test_log_range_open_end(self):
976
self.assertLogRevnos(["-r1.."], ["2", "1"])
978
class TestLogMatch(TestLogWithLogCatcher):
979
def prepare_tree(self):
980
tree = self.make_branch_and_tree('')
982
['/hello.txt', '/goodbye.txt'])
983
tree.add('hello.txt')
984
tree.commit(message='message1', committer='committer1', authors=['author1'])
985
tree.add('goodbye.txt')
986
tree.commit(message='message2', committer='committer2', authors=['author2'])
988
def test_message(self):
990
self.assertLogRevnos(["-m", "message1"], ["1"])
991
self.assertLogRevnos(["-m", "message2"], ["2"])
992
self.assertLogRevnos(["-m", "message"], ["2", "1"])
993
self.assertLogRevnos(["-m", "message1", "-m", "message2"], ["2", "1"])
994
self.assertLogRevnos(["--match-message", "message1"], ["1"])
995
self.assertLogRevnos(["--match-message", "message2"], ["2"])
996
self.assertLogRevnos(["--match-message", "message"], ["2", "1"])
997
self.assertLogRevnos(["--match-message", "message1",
998
"--match-message", "message2"], ["2", "1"])
999
self.assertLogRevnos(["--message", "message1"], ["1"])
1000
self.assertLogRevnos(["--message", "message2"], ["2"])
1001
self.assertLogRevnos(["--message", "message"], ["2", "1"])
1002
self.assertLogRevnos(["--match-message", "message1",
1003
"--message", "message2"], ["2", "1"])
1004
self.assertLogRevnos(["--message", "message1",
1005
"--match-message", "message2"], ["2", "1"])
1007
def test_committer(self):
1009
self.assertLogRevnos(["-m", "committer1"], ["1"])
1010
self.assertLogRevnos(["-m", "committer2"], ["2"])
1011
self.assertLogRevnos(["-m", "committer"], ["2", "1"])
1012
self.assertLogRevnos(["-m", "committer1", "-m", "committer2"],
1014
self.assertLogRevnos(["--match-committer", "committer1"], ["1"])
1015
self.assertLogRevnos(["--match-committer", "committer2"], ["2"])
1016
self.assertLogRevnos(["--match-committer", "committer"], ["2", "1"])
1017
self.assertLogRevnos(["--match-committer", "committer1",
1018
"--match-committer", "committer2"], ["2", "1"])
1020
def test_author(self):
1022
self.assertLogRevnos(["-m", "author1"], ["1"])
1023
self.assertLogRevnos(["-m", "author2"], ["2"])
1024
self.assertLogRevnos(["-m", "author"], ["2", "1"])
1025
self.assertLogRevnos(["-m", "author1", "-m", "author2"],
1027
self.assertLogRevnos(["--match-author", "author1"], ["1"])
1028
self.assertLogRevnos(["--match-author", "author2"], ["2"])
1029
self.assertLogRevnos(["--match-author", "author"], ["2", "1"])
1030
self.assertLogRevnos(["--match-author", "author1",
1031
"--match-author", "author2"], ["2", "1"])