/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_commit.py

  • Committer: Andrew Bennetts
  • Date: 2008-09-08 12:59:00 UTC
  • mfrom: (3695 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080908125900-8ywtsr7jqyyatjz0
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

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