985
986
self.assertNotContainsRe(log, '^3:', re.MULTILINE)
986
987
self.assertNotContainsRe(log, '^3.1.1:', re.MULTILINE)
987
988
self.assertNotContainsRe(log, '^4:', re.MULTILINE)
991
class TestLogMultiple(TestCaseWithTransport):
993
def prepare_tree(self):
994
tree = self.make_branch_and_tree('parent')
1000
'parent/dir1/dir2/',
1001
'parent/dir1/dir2/file3',
1004
tree.commit('add file1')
1006
tree.commit('add file2')
1007
tree.add(['dir1', 'dir1/dir2', 'dir1/dir2/file3'])
1008
tree.commit('add file3')
1010
tree.commit('add file4')
1011
tree.add('dir1/file5')
1012
tree.commit('add file5')
1013
child_tree = tree.bzrdir.sprout('child').open_workingtree()
1014
self.build_tree_contents([('child/file2', 'hello')])
1015
child_tree.commit(message='branch 1')
1016
tree.merge_from_branch(child_tree.branch)
1017
tree.commit(message='merge child branch')
1020
def assertRevnos(self, paths_str, expected_revnos):
1021
# confirm the revision numbers in log --line output are those expected
1022
out, err = self.run_bzr('log --line -n0 %s' % (paths_str,))
1023
self.assertEqual('', err)
1024
revnos = [s.split(':', 1)[0].lstrip() for s in out.splitlines()]
1025
self.assertEqual(expected_revnos, revnos)
1027
def test_log_files(self):
1028
"""The log for multiple file should only list revs for those files"""
1030
self.assertRevnos('file1 file2 dir1/dir2/file3',
1031
['6', '5.1.1', '3', '2', '1'])
1033
def test_log_directory(self):
1034
"""The log for a directory should show all nested files."""
1036
self.assertRevnos('dir1', ['5', '3'])
1038
def test_log_nested_directory(self):
1039
"""The log for a directory should show all nested files."""
1041
self.assertRevnos('dir1/dir2', ['3'])
1043
def test_log_in_nested_directory(self):
1044
"""The log for a directory should show all nested files."""
1047
self.assertRevnos('.', ['5', '3'])
1049
def test_log_files_and_directories(self):
1050
"""Logging files and directories together should be fine."""
1052
self.assertRevnos('file4 dir1/dir2', ['4', '3'])
1054
def test_log_files_and_dirs_in_nested_directory(self):
1055
"""The log for a directory should show all nested files."""
1058
self.assertRevnos('dir2 file5', ['5', '3'])