[PATCH] Proper error message when specifying empty commit message

Jelmer Vernooij jelmer at samba.org
Sun Oct 2 14:19:00 BST 2005


Hi Robert, 

Sorry about the late reply.  Thanks for the feedback. 

On Wed, Sep 07, 2005 at 09:55:18PM +1000, Robert Collins wrote about 'Re: [PATCH] Proper error message when specifying empty commit message':
> On Tue, 2005-09-06 at 19:38 +0200, Jelmer Vernooij wrote:
> > Attached is a small patch that fixes the error message when an empty
> > commit message was specified (when using an editor). Previously it
> > warned that it wanted either --message or --file. I hope I'm using the
> > right exception (BzrCommandError).

> > Alternatively, the patch can be pulled from http://jelmer.vernstok.nl/bzr/

> Hi Jelmer, thanks for this patch. There are a couple of small quirks
> with it before it is ready for inclusion...

> Firstly, please configure your editor not to insert literal TAB
> characters in *.py files. IIRC this is standard for PEP-8 in the python
> community.

> I agree with Michaels suggestion of len(msg.strip()) == 0 as the test.
msg[] is an array of lines so strip() won't work on it. The for loop before 
this line (see msgeditor.py:99) already removes lines that only contain
whitespace and appear before the actual commit message.

> The except class is fine.

> The other thing that is missing (and why I'm asking you to do this
> rather than just tweaking the other minor stuff), is to write a test for
> this. You can see the HACKING file for information on tests. I suggest a
> blackbox test for this particular change.
I've added a simple test that checks exactly this. The updated patch
and a small fix for setup.py can be pulled from http://jelmer.vernstok.nl/bzr/.

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://jelmer.vernstok.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051002/839109f8/attachment.pgp 


More information about the bazaar mailing list