~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2008-08-04 07:29:51 UTC
  • mto: This revision was merged to the branch mainline in revision 3603.
  • Revision ID: robertc@robertcollins.net-20080804072951-tdue3y4bp9893yx9
Add support for -x or --exclude to bzr commit, fixing bug 3117. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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')
333
333
 
 
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 ignored it will still be 'added' in status.
 
343
        out, err = self.run_bzr(['added'])
 
344
        self.assertEqual('b\n', out)
 
345
        self.assertEqual('', err)
 
346
 
 
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 ignored it will still be 'added' in status.
 
358
        out, err = self.run_bzr(['added'])
 
359
        self.assertEqual('b\nc\n', out)
 
360
        self.assertEqual('', err)
 
361
 
334
362
    def test_commit_respects_spec_for_removals(self):
335
363
        """Commit with a file spec should only commit removals that match"""
336
364
        t = self.make_branch_and_tree('.')