/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: Canonical.com Patch Queue Manager
  • Date: 2011-04-08 07:24:21 UTC
  • mfrom: (5765.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20110408072421-81nrdsapywozyyft
(spiv) Update the PointlessCommit error message. [a=Federico Culloca] (John
 A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests for the commit CLI of bzr."""
19
19
 
 
20
import doctest
20
21
import os
21
22
import re
22
23
import sys
23
24
 
 
25
from testtools.matchers import DocTestMatches
 
26
 
24
27
from bzrlib import (
25
 
    bzrdir,
26
28
    config,
27
29
    osutils,
28
30
    ignores,
29
31
    msgeditor,
30
 
    osutils,
31
32
    tests,
32
33
    )
33
34
from bzrlib.bzrdir import BzrDir
48
49
        self.build_tree(['hello.txt'])
49
50
        out,err = self.run_bzr('commit -m empty', retcode=3)
50
51
        self.assertEqual('', out)
51
 
        self.assertContainsRe(err, 'bzr: ERROR: No changes to commit\.'
52
 
                                  ' Use --unchanged to commit anyhow.\n')
 
52
        # Two ugly bits here.
 
53
        # 1) We really don't want 'aborting commit write group' anymore.
 
54
        # 2) bzr: ERROR: is a really long line, so we wrap it with '\'
 
55
        self.assertThat(
 
56
            err,
 
57
            DocTestMatches("""\
 
58
Committing to: ...
 
59
aborting commit write group: PointlessCommit(No changes to commit)
 
60
bzr: ERROR: No changes to commit.\
 
61
 Please 'bzr add' the files you want to commit,\
 
62
 or use --unchanged to force an empty commit.
 
63
""", flags=doctest.ELLIPSIS|doctest.REPORT_UDIFF))
53
64
 
54
65
    def test_commit_success(self):
55
66
        """Successful commit should not leave behind a bzr-commit-* file"""