73
73
wt.rename_one('hello.txt', 'gutentag.txt')
74
74
out, err = self.run_bzr("commit", "-m", "renamed")
75
75
self.assertEqual('', out)
76
self.assertEqual('renamed gutentag.txt\n'
76
self.assertEqual('renamed hello.txt => gutentag.txt\n'
77
77
'Committed revision 2.\n',
86
86
out, err = self.run_bzr("commit", "-m", "renamed")
87
87
self.assertEqual('', out)
88
88
self.assertEqualDiff('added subdir\n'
89
'renamed subdir/hello.txt\n'
89
'renamed hello.txt => subdir/hello.txt\n'
90
90
'Committed revision 2.\n',
102
102
'Committed revision 1.\n',
105
def test_16_verbose_commit_with_unchanged(self):
105
def test_verbose_commit_with_unchanged(self):
106
106
"""Unchanged files should not be listed by default in verbose output"""
107
107
self.runbzr("init")
108
108
self.build_tree(['hello.txt', 'unchanged.txt'])
115
115
'Committed revision 2.\n',
118
def test_commit_merge_reports_all_modified_files(self):
119
# the commit command should show all the files that are shown by
120
# bzr diff or bzr status when committing, even when they were not
121
# changed by the user but rather through doing a merge.
122
this_tree = self.make_branch_and_tree('this')
123
# we need a bunch of files and dirs, to perform one action on each.
126
'this/dirtoreparent/',
129
'this/filetoreparent',
146
this_tree.commit('create_files')
147
other_dir = this_tree.bzrdir.sprout('other')
148
other_tree = other_dir.open_workingtree()
149
other_tree.lock_write()
150
# perform the needed actions on the files and dirs.
152
other_tree.rename_one('dirtorename', 'renameddir')
153
other_tree.rename_one('dirtoreparent', 'renameddir/reparenteddir')
154
other_tree.rename_one('filetorename', 'renamedfile')
155
other_tree.rename_one('filetoreparent', 'renameddir/reparentedfile')
156
other_tree.remove(['dirtoremove', 'filetoremove'])
157
self.build_tree_contents([
159
('other/filetomodify', 'new content'),
160
('other/newfile', 'new file content')])
161
other_tree.add('newfile')
162
other_tree.add('newdir/')
163
other_tree.commit('modify all sample files and dirs.')
166
self.merge(other_tree.branch, this_tree)
168
out,err = self.run_bzr("commit", "-m", "added")
170
self.assertEqual('', out)
171
self.assertEqualDiff(
172
'modified filetomodify\n'
175
'renamed dirtorename => renameddir\n'
176
'renamed dirtoreparent => renameddir/reparenteddir\n'
177
'renamed filetoreparent => renameddir/reparentedfile\n'
178
'renamed filetorename => renamedfile\n'
179
'deleted dirtoremove\n'
180
'deleted filetoremove\n'
181
'Committed revision 2.\n',
118
184
def test_empty_commit_message(self):
119
185
self.runbzr("init")
120
186
file('foo.c', 'wt').write('int main() {}')