[merge] make "bzr testament" work with unicode commit messages
John A Meinel
john at arbash-meinel.com
Thu Feb 16 17:02:38 GMT 2006
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.
>
I have one small comment, but I merged you changes anyway.
You have the line:
+ self.assertEqualDiff(
+ t.as_text(), SAMPLE_UNICODE_TESTAMENT.encode('utf-8'))
We generally prefer to have the 'expected' text be the first parameter,
and the 'actual' be the second.
This is kind of an informal thing, but something we try for.
I merged you (and fixed up that one line) into jam-integration, revno
1535 and 1536.
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/51ee6ea0/attachment.pgp
More information about the bazaar
mailing list