~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: 2006-11-23 07:00:38 UTC
  • mfrom: (1551.9.5 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20061123070038-57f13b951191257e
Revert broken save-commit-message code

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import re
22
22
import sys
23
23
 
 
24
from bzrlib import (
 
25
    ignores,
 
26
    )
24
27
from bzrlib.branch import Branch
25
28
from bzrlib.bzrdir import BzrDir
26
29
from bzrlib.errors import BzrCommandError
40
43
        self.assertStartsWith(err, 'bzr: ERROR: no changes to commit.'
41
44
                                  ' use --unchanged to commit anyhow\n')
42
45
 
43
 
    def test_save_commit_message(self):
44
 
        """Failed commit should save the message in a file"""
45
 
        self.run_bzr("init")
46
 
        out,err = self.run_bzr("commit", "-m", "message", retcode=3)
47
 
        self.assertEqual('', out)
48
 
        self.assertStartsWith(err, 'bzr: ERROR: no changes to commit.'
49
 
                                  ' use --unchanged to commit anyhow\n'
50
 
                                  'Commit message saved. To reuse the message,'
51
 
                                  ' do\nbzr commit --file ')
52
 
        message_file = re.compile('bzr-commit-\S*').search(err).group()
53
 
        self.check_file_contents(message_file, 'message')
54
 
 
55
46
    def test_commit_success(self):
56
47
        """Successful commit should not leave behind a bzr-commit-* file"""
57
48
        self.run_bzr("init")
325
316
 
326
317
    def test_strict_commit(self):
327
318
        """Commit with --strict works if everything is known"""
 
319
        ignores._set_user_ignores([])
328
320
        tree = self.make_branch_and_tree('tree')
329
321
        self.build_tree(['tree/a'])
330
322
        tree.add('a')