[merge] make "bzr testament" work with unicode commit messages
Robert Collins
robertc at robertcollins.net
Mon Feb 13 22:12:32 GMT 2006
On Mon, 2006-02-13 at 16:09 +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.
perhaps make it more clear:
SAMPLE_UNICODE_TESTAMENT=u"""....
"""
and in the assertion:
self.assertEqual(SAMPLE_UNICODE_TESTAMENT.encode('utf8'), ...)
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060214/4cc996ca/attachment.pgp
More information about the bazaar
mailing list