73
73
def test_annotate_cmd_revision(self):
74
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r 1'])
74
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r1'])
75
75
self.assertEquals(err, '')
76
76
self.assertEqualDiff(out, '''\
77
77
1 test@us | my helicopter
80
80
def test_annotate_cmd_revision3(self):
81
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r 3'])
81
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r3'])
82
82
self.assertEquals(err, '')
83
83
self.assertEqualDiff(out, '''\
84
84
1 test@us | my helicopter
88
88
def test_annotate_cmd_unknown_revision(self):
89
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r 10'],
89
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r', '10'],
91
91
self.assertEquals(out, '')
92
self.assertContainsRe(err, 'has no revision 10')
92
self.assertContainsRe(err, 'Requested revision: \'10\' does not exist')
94
94
def test_annotate_cmd_two_revisions(self):
95
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r 1..2'],
95
out, err = self.run_bzr_captured(['annotate', 'hello.txt', '-r1..2'],
97
97
self.assertEquals(out, '')
98
98
self.assertEquals(err, 'bzr: ERROR: bzr annotate --revision takes'
99
99
' exactly 1 argument\n')
101
def test_annotate_empty_file(self):
102
tree = self.make_branch_and_tree('tree')
103
self.build_tree_contents([('tree/empty', '')])
105
tree.commit('add empty file')
108
out, err = self.run_bzr('annotate', 'empty')
109
self.assertEqual('', out)