331
331
self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
332
332
self.run_bzr('commit -m checkin-merge-of-the-offline-work-from-u1 u1')
334
def test_commit_exclude_excludes_modified_files(self):
335
"""Commit -x foo should ignore changes to foo."""
336
tree = self.make_branch_and_tree('.')
337
self.build_tree(['a', 'b', 'c'])
338
tree.smart_add(['.'])
339
out, err = self.run_bzr(['commit', '-m', 'test', '-x', 'b'])
340
self.assertFalse('added b' in out)
341
self.assertFalse('added b' in err)
342
# If b was excluded it will still be 'added' in status.
343
out, err = self.run_bzr(['added'])
344
self.assertEqual('b\n', out)
345
self.assertEqual('', err)
347
def test_commit_exclude_twice_uses_both_rules(self):
348
"""Commit -x foo -x bar should ignore changes to foo and bar."""
349
tree = self.make_branch_and_tree('.')
350
self.build_tree(['a', 'b', 'c'])
351
tree.smart_add(['.'])
352
out, err = self.run_bzr(['commit', '-m', 'test', '-x', 'b', '-x', 'c'])
353
self.assertFalse('added b' in out)
354
self.assertFalse('added c' in out)
355
self.assertFalse('added b' in err)
356
self.assertFalse('added c' in err)
357
# If b was excluded it will still be 'added' in status.
358
out, err = self.run_bzr(['added'])
359
self.assertTrue('b\n' in out)
360
self.assertTrue('c\n' in out)
361
self.assertEqual('', err)
334
363
def test_commit_respects_spec_for_removals(self):
335
364
"""Commit with a file spec should only commit removals that match"""
336
365
t = self.make_branch_and_tree('.')