[merge] bzr whoami

Robey Pointer robey at lag.net
Wed Jul 12 17:32:04 BST 2006


On 12 Jul 2006, at 8:58, John Arbash Meinel wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robey Pointer wrote:
>>
>
> ...
>
>>> Can you add a blackbox test to make sure a warning is being  
>>> printed if
>>> the user doesn't supply an email address?
>>
>> Okay, done.
>>
>> http://www.lag.net/code/bzr.dev.whoami/
>>
>> robey
>
>
> One thing I didn't catch before, arguments parsed from the command  
> line
> are in Unicode, so we get this warning:
> u'foobar' doesn't seem to contain a reasonable email address
>
>
> Which doesn't look very nice. (One of the consequences of our current
> 'use the exception as the error message' decision).
>
> The other problem is we give a warning, but don't tell the user  
> that we
> are accepting what they wrote anyway. It was unclear when reading that
> message what had happened.
>
> So I think it would be better to do:
>
> try:
>   config.extract_email_address(name)
> except BzrError, e:
>   warning('"%s" does not seem to contain an email address.\n'
>           'This is allowed, but not recommended\n', name)
>
> If you can fix this up, and update the test, I'll submit it today.

Okay, I did that (but removing the extra linefeeds).  Martin says  
he's going to cause warnings to be prefixed with "warning:" soon, so  
that will probably help to reassure the user it's not a fatal error too.

robey





More information about the bazaar mailing list