514
541
def test_include_merges(self):
515
542
# Confirm --include-merges gives the same output as -n0
516
self.assertLogRevnos(['--include-merges'],
517
['2', '1.1.2', '1.2.1', '1.1.1', '1'],
518
working_dir='level0')
519
self.assertLogRevnos(['--include-merges'],
520
['2', '1.1.2', '1.2.1', '1.1.1', '1'],
521
working_dir='level0')
543
msg = ("The option '--include-merges' to 'bzr log' "
544
"has been deprecated in bzr 2.5. "
545
"Please use '--include-merged' instead.\n")
546
self.assertLogRevnos(['--include-merges'],
547
['2', '1.1.2', '1.2.1', '1.1.1', '1'],
548
working_dir='level0', err=msg)
549
self.assertLogRevnos(['--include-merges'],
550
['2', '1.1.2', '1.2.1', '1.1.1', '1'],
551
working_dir='level0', err=msg)
522
552
out_im, err_im = self.run_bzr('log --include-merges',
523
553
working_dir='level0')
524
554
out_n0, err_n0 = self.run_bzr('log -n0', working_dir='level0')
525
self.assertEqual('', err_im)
555
self.assertEqual(msg, err_im)
526
556
self.assertEqual('', err_n0)
527
557
self.assertEqual(out_im, out_n0)
559
def test_include_merged(self):
560
# Confirm --include-merged gives the same output as -n0
561
expected = ['2', '1.1.2', '1.2.1', '1.1.1', '1']
562
self.assertLogRevnos(['--include-merged'],
563
expected, working_dir='level0')
564
self.assertLogRevnos(['--include-merged'],
565
expected, working_dir='level0')
529
567
def test_force_merge_revisions_N(self):
530
568
self.assertLogRevnos(['-n2'],
531
569
['2', '1.1.2', '1.1.1', '1'],
924
970
self.prepare_tree()
926
972
self.assertLogRevnos(['dir2', 'file5'], ['5', '3'])
975
class MainlineGhostTests(TestLogWithLogCatcher):
978
super(MainlineGhostTests, self).setUp()
979
tree = self.make_branch_and_tree('')
980
tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
982
tree.commit('msg1', rev_id='rev1')
983
tree.commit('msg2', rev_id='rev2')
985
def test_log_range(self):
986
self.assertLogRevnos(["-r1..2"], ["2", "1"])
988
def test_log_norange(self):
989
self.assertLogRevnos([], ["2", "1"])
991
def test_log_range_open_begin(self):
992
self.knownFailure("log with ghosts fails. bug #726466")
993
(stdout, stderr) = self.run_bzr(['log', '-r..2'], retcode=3)
994
self.assertEqual(["2", "1"],
995
[r.revno for r in self.get_captured_revisions()])
996
self.assertEquals("bzr: ERROR: Further revision history missing.", stderr)
998
def test_log_range_open_end(self):
999
self.assertLogRevnos(["-r1.."], ["2", "1"])
1001
class TestLogMatch(TestLogWithLogCatcher):
1002
def prepare_tree(self):
1003
tree = self.make_branch_and_tree('')
1005
['/hello.txt', '/goodbye.txt'])
1006
tree.add('hello.txt')
1007
tree.commit(message='message1', committer='committer1', authors=['author1'])
1008
tree.add('goodbye.txt')
1009
tree.commit(message='message2', committer='committer2', authors=['author2'])
1011
def test_message(self):
1013
self.assertLogRevnos(["-m", "message1"], ["1"])
1014
self.assertLogRevnos(["-m", "message2"], ["2"])
1015
self.assertLogRevnos(["-m", "message"], ["2", "1"])
1016
self.assertLogRevnos(["-m", "message1", "-m", "message2"], ["2", "1"])
1017
self.assertLogRevnos(["--match-message", "message1"], ["1"])
1018
self.assertLogRevnos(["--match-message", "message2"], ["2"])
1019
self.assertLogRevnos(["--match-message", "message"], ["2", "1"])
1020
self.assertLogRevnos(["--match-message", "message1",
1021
"--match-message", "message2"], ["2", "1"])
1022
self.assertLogRevnos(["--message", "message1"], ["1"])
1023
self.assertLogRevnos(["--message", "message2"], ["2"])
1024
self.assertLogRevnos(["--message", "message"], ["2", "1"])
1025
self.assertLogRevnos(["--match-message", "message1",
1026
"--message", "message2"], ["2", "1"])
1027
self.assertLogRevnos(["--message", "message1",
1028
"--match-message", "message2"], ["2", "1"])
1030
def test_committer(self):
1032
self.assertLogRevnos(["-m", "committer1"], ["1"])
1033
self.assertLogRevnos(["-m", "committer2"], ["2"])
1034
self.assertLogRevnos(["-m", "committer"], ["2", "1"])
1035
self.assertLogRevnos(["-m", "committer1", "-m", "committer2"],
1037
self.assertLogRevnos(["--match-committer", "committer1"], ["1"])
1038
self.assertLogRevnos(["--match-committer", "committer2"], ["2"])
1039
self.assertLogRevnos(["--match-committer", "committer"], ["2", "1"])
1040
self.assertLogRevnos(["--match-committer", "committer1",
1041
"--match-committer", "committer2"], ["2", "1"])
1043
def test_author(self):
1045
self.assertLogRevnos(["-m", "author1"], ["1"])
1046
self.assertLogRevnos(["-m", "author2"], ["2"])
1047
self.assertLogRevnos(["-m", "author"], ["2", "1"])
1048
self.assertLogRevnos(["-m", "author1", "-m", "author2"],
1050
self.assertLogRevnos(["--match-author", "author1"], ["1"])
1051
self.assertLogRevnos(["--match-author", "author2"], ["2"])
1052
self.assertLogRevnos(["--match-author", "author"], ["2", "1"])
1053
self.assertLogRevnos(["--match-author", "author1",
1054
"--match-author", "author2"], ["2", "1"])