~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-18 01:00:18 UTC
  • mfrom: (6064.1.4 empty-commit-message)
  • Revision ID: pqm@pqm.ubuntu.com-20110818010018-zs13cq955e0hc335
(jelmer) Support forcing empty commit messages with -m. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    osutils,
30
30
    ignores,
31
31
    msgeditor,
32
 
    tests,
33
32
    )
34
33
from bzrlib.bzrdir import BzrDir
35
34
from bzrlib.tests import (
36
 
    probe_bad_non_ascii,
37
35
    test_foreign,
38
 
    TestSkipped,
39
36
    features,
40
37
    )
41
38
from bzrlib.tests import TestCaseWithTransport
332
329
        tree = self.make_branch_and_tree('.')
333
330
        self.build_tree_contents([('foo.c', 'int main() {}')])
334
331
        tree.add('foo.c')
335
 
        self.run_bzr('commit -m ""', retcode=3)
 
332
        self.run_bzr('commit -m ""')
336
333
 
337
334
    def test_other_branch_commit(self):
338
335
        # this branch is to ensure consistent behaviour, whether we're run
741
738
        tree.add('hello.txt')
742
739
        return tree
743
740
 
 
741
    def test_edit_empty_message(self):
 
742
        tree = self.make_branch_and_tree('tree')
 
743
        self.setup_editor()
 
744
        self.build_tree(['tree/hello.txt'])
 
745
        tree.add('hello.txt')
 
746
        out, err = self.run_bzr("commit tree/hello.txt", retcode=3,
 
747
            stdin="y\n")
 
748
        self.assertContainsRe(err,
 
749
            "bzr: ERROR: Empty commit message specified")
 
750
 
744
751
    def test_commit_hook_template_accepted(self):
745
752
        tree = self.setup_commit_with_template()
746
753
        out, err = self.run_bzr("commit tree/hello.txt", stdin="y\n")