[merge] make "bzr testament" work with unicode commit messages

John A Meinel john at arbash-meinel.com
Thu Feb 16 17:03:20 GMT 2006


Marien Zwart wrote:
> On Mon, Feb 13, 2006 at 04:09:39PM +0100, Marien Zwart wrote:
>> On Mon, Feb 13, 2006 at 06:10:29PM +1100, Robert Collins wrote:
>>> The test is currently faulty - it checks for unicode equivalence, not
>>> for utf8 equivalence.
>>>
>>> The check should be an assert for equality of two '.encode('utf8')'ed
>>> byte sequences, not of unicode strings.
>> That's what it is doing: there is a .encode('utf-8') hidden at the end
>> of the REV_UNICODE_COMMIT_TESTAMENT definition, and my patch makes
>> as_text_lines return utf8-encoded byte sequences, instead of the
>> unicode objects it returned previously. Unless how .encode('utf-8')
>> encodes things changes this should work.
>>
>> If you think it's better I can replace the definition of
>> REV_UNICODE_COMMIT_TESTAMENT with a hardcoded byte string instead of
>> letting python utf8-encode a hardcoded unicode object.
> 
> (shamelessly "bumping" my own thread :P)
> 
> Based on a suggestion from Robert Collins I made it a bit more
> explicit that the test is comparing bytestrings instead of unicode
> objects by moving the .encode into the test itself. Is this ok now or
> does it need further changes/improvements?
> 

I already merged it. I just hadn't given the announcement until all
tests passed. :)

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060216/10daacc5/attachment.pgp 


More information about the bazaar mailing list