[PATCH] Proper error message when specifying empty commit message

Michael Ellerman michael at ellerman.id.au
Wed Sep 7 01:06:42 BST 2005


On Wed, 7 Sep 2005 03:38, Jelmer Vernooij wrote:
> Hi,
>
> 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).

> *** modified file 'bzrlib/msgeditor.py'
> --- bzrlib/msgeditor.py 
> +++ bzrlib/msgeditor.py 
> @@ -107,7 +107,7 @@
>              msg.append(line)
>              
>          if len(msg) == 0:
> -            return None
> +            return ""
>          # delete empty lines at the end
>          del msg[lastline:]
>          # add a newline at the end, if needed

It probably be smart to do len(msg.strip()) == 0, otherwise you can get around 
that logic by having a commit message of " ".

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050907/cad23d52/attachment.pgp 


More information about the bazaar mailing list