Rev 6081: (jelmer) Support forcing empty commit messages with -m. (Jelmer Vernooij) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Aug 18 01:00:44 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6081 [merge]
revision-id: pqm at pqm.ubuntu.com-20110818010018-zs13cq955e0hc335
parent: pqm at pqm.ubuntu.com-20110817213937-lzul6u2qz1svvgxm
parent: jelmer at samba.org-20110817105642-ylchwcdkryuy4ls4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2011-08-18 01:00:18 +0000
message:
(jelmer) Support forcing empty commit messages with -m. (Jelmer Vernooij)
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
doc/en/release-notes/bzr-2.5.txt bzr2.5.txt-20110708125756-587p0hpw7oke4h05-1
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2011-08-17 02:08:00 +0000
+++ b/bzrlib/builtins.py 2011-08-18 01:00:18 +0000
@@ -3327,11 +3327,11 @@
if my_message is None:
raise errors.BzrCommandError("please specify a commit"
" message with either --message or --file")
- if my_message == "":
- raise errors.BzrCommandError("Empty commit message specified."
- " Please specify a commit message with either"
- " --message or --file or leave a blank message"
- " with --message \"\".")
+ if my_message == "":
+ raise errors.BzrCommandError("Empty commit message specified."
+ " Please specify a commit message with either"
+ " --message or --file or leave a blank message"
+ " with --message \"\".")
return my_message
# The API permits a commit with a filter of [] to mean 'select nothing'
=== modified file 'bzrlib/tests/blackbox/test_commit.py'
--- a/bzrlib/tests/blackbox/test_commit.py 2011-08-13 23:07:36 +0000
+++ b/bzrlib/tests/blackbox/test_commit.py 2011-08-17 10:56:42 +0000
@@ -29,13 +29,10 @@
osutils,
ignores,
msgeditor,
- tests,
)
from bzrlib.bzrdir import BzrDir
from bzrlib.tests import (
- probe_bad_non_ascii,
test_foreign,
- TestSkipped,
features,
)
from bzrlib.tests import TestCaseWithTransport
@@ -332,7 +329,7 @@
tree = self.make_branch_and_tree('.')
self.build_tree_contents([('foo.c', 'int main() {}')])
tree.add('foo.c')
- self.run_bzr('commit -m ""', retcode=3)
+ self.run_bzr('commit -m ""')
def test_other_branch_commit(self):
# this branch is to ensure consistent behaviour, whether we're run
@@ -741,6 +738,16 @@
tree.add('hello.txt')
return tree
+ def test_edit_empty_message(self):
+ tree = self.make_branch_and_tree('tree')
+ self.setup_editor()
+ self.build_tree(['tree/hello.txt'])
+ tree.add('hello.txt')
+ out, err = self.run_bzr("commit tree/hello.txt", retcode=3,
+ stdin="y\n")
+ self.assertContainsRe(err,
+ "bzr: ERROR: Empty commit message specified")
+
def test_commit_hook_template_accepted(self):
tree = self.setup_commit_with_template()
out, err = self.run_bzr("commit tree/hello.txt", stdin="y\n")
=== modified file 'doc/en/release-notes/bzr-2.5.txt'
--- a/doc/en/release-notes/bzr-2.5.txt 2011-08-17 18:13:57 +0000
+++ b/doc/en/release-notes/bzr-2.5.txt 2011-08-18 01:00:18 +0000
@@ -81,6 +81,10 @@
.. Improvements to existing commands, especially improved performance
or memory usage, or better results.
+* ``bzr commit -m ''`` can now be used to force an empty commit message.
+ Entering an empty commit message in the message editor still triggers
+ an error. (Jelmer Vernooij)
+
Bug Fixes
*********
More information about the bazaar-commits
mailing list