~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: 2006-08-08 23:19:29 UTC
  • mfrom: (1884 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1912.
  • Revision ID: robertc@robertcollins.net-20060808231929-4e3e298190214b3a
current status

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    def test_05_empty_commit(self):
34
34
        """Commit of tree with no versioned files should fail"""
35
35
        # If forced, it should succeed, but this is not tested here.
36
 
        self.runbzr("init")
 
36
        self.run_bzr("init")
37
37
        self.build_tree(['hello.txt'])
38
 
        self.runbzr("commit -m empty", retcode=3)
 
38
        result = self.run_bzr("commit", "-m", "empty", retcode=3)
 
39
        self.assertEqual(('', 'bzr: ERROR: no changes to commit.'
 
40
                              ' use --unchanged to commit anyhow\n'),
 
41
                         result)
39
42
 
40
43
    def test_commit_with_path(self):
41
44
        """Commit tree with path of root specified"""
284
287
        # version or the u2 version.
285
288
        self.build_tree_contents([('u1/hosts', 'merge resolution\n')])
286
289
        self.run_bzr('commit', '-m', 'checkin merge of the offline work from u1', 'u1')
 
290
 
 
291
    def test_commit_respects_spec_for_removals(self):
 
292
        """Commit with a file spec should only commit removals that match"""
 
293
        t = self.make_branch_and_tree('.')
 
294
        self.build_tree(['file-a', 'dir-a/', 'dir-a/file-b'])
 
295
        t.add(['file-a', 'dir-a', 'dir-a/file-b'])
 
296
        t.commit('Create')
 
297
        t.remove(['file-a', 'dir-a/file-b'])
 
298
        os.chdir('dir-a')
 
299
        result = self.run_bzr('commit', '.', '-m' 'removed file-b')[1]
 
300
        self.assertNotContainsRe(result, 'file-a')
 
301
        result = self.run_bzr('status')[0]
 
302
        self.assertContainsRe(result, 'removed:\n  file-a')