Rev 5768: (spiv) Update the PointlessCommit error message. [a=Federico Culloca] (John in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Apr 8 07:24:26 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5768 [merge]
revision-id: pqm at pqm.ubuntu.com-20110408072421-81nrdsapywozyyft
parent: pqm at pqm.ubuntu.com-20110408051630-wlk2z0cv73walyz0
parent: john at arbash-meinel.com-20110407130839-k2m8skey04znbbxd
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-04-08 07:24:21 +0000
message:
(spiv) Update the PointlessCommit error message. [a=Federico Culloca] (John
A Meinel)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-04-01 08:00:04 +0000
+++ b/bzrlib/builtins.py 2011-04-07 11:25:14 +0000
@@ -3273,7 +3273,8 @@
exclude=tree.safe_relpath_files(exclude))
except PointlessCommit:
raise errors.BzrCommandError("No changes to commit."
- " Use --unchanged to commit anyhow.")
+ " Please 'bzr add' the files you want to commit, or use"
+ " --unchanged to force an empty commit.")
except ConflictsInTree:
raise errors.BzrCommandError('Conflicts detected in working '
'tree. Use "bzr conflicts" to list, "bzr resolve FILE" to'
=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py 2011-04-06 04:18:06 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py 2011-04-07 13:08:39 +0000
@@ -17,17 +17,18 @@
"""Tests for the commit CLI of bzr."""
+import doctest
import os
import re
import sys
+from testtools.matchers import DocTestMatches
+
from bzrlib import (
- bzrdir,
config,
osutils,
ignores,
msgeditor,
- osutils,
tests,
)
from bzrlib.bzrdir import BzrDir
@@ -48,8 +49,18 @@
self.build_tree(['hello.txt'])
out,err = self.run_bzr('commit -m empty', retcode=3)
self.assertEqual('', out)
- self.assertContainsRe(err, 'bzr: ERROR: No changes to commit\.'
- ' Use --unchanged to commit anyhow.\n')
+ # Two ugly bits here.
+ # 1) We really don't want 'aborting commit write group' anymore.
+ # 2) bzr: ERROR: is a really long line, so we wrap it with '\'
+ self.assertThat(
+ err,
+ DocTestMatches("""\
+Committing to: ...
+aborting commit write group: PointlessCommit(No changes to commit)
+bzr: ERROR: No changes to commit.\
+ Please 'bzr add' the files you want to commit,\
+ or use --unchanged to force an empty commit.
+""", flags=doctest.ELLIPSIS|doctest.REPORT_UDIFF))
def test_commit_success(self):
"""Successful commit should not leave behind a bzr-commit-* file"""
More information about the bazaar-commits
mailing list