[merge][0.11] updates to rio and version_info

John Arbash Meinel john at arbash-meinel.com
Fri Sep 22 06:52:45 BST 2006


Matthew Fuller noticed that 'bzr version-info --all' fails in bzr.dev.
This is because I'm attempting to create a nested Stanzas, and was doing
so incorrectly. I forgot that the output of 'RioWriter()' was a utf-8
encoded string, but that Stanza.add() requires a Unicode string.

Which means that with the current Stanza api, you need to decode your
string after it is generated, before you can add it to the parent Stanza.

Rather than doing that, I added a 'Stanza.to_unicode()' that doesn't do
any encoding. Instead it just creates a unicode string, which can then
be passed to a parent Stanza.

And then I updated read_stanza() so that it doesn't try to decode a
string that is already Unicode.

Then I updated 'version-info' so that it uses the right apis, and can
thus handle unicode commit messages, etc.

And finally, I fixed a timing bug in the version-info blackbox test.
Because 'version-info' includes the 'build-date' (right now), two runs
right after eachother have the possibility to create a different
timestamp, if the clock ticks inbetween.

So instead of using 'self.assertEqual()' I created a helper that asserts
the texts are equal except for the 'build-date' line.

The Stanza api changes are not strictly necessary. I could instead
always .encode() or .decode() before reading/adding a child Stanza. But
doing it this way is better for performance, and I think more natural
for people who want to use Stanzas.

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update-rio-version-info.patch
Type: text/x-patch
Size: 18290 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060922/8eade93e/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060922/8eade93e/attachment.pgp 


More information about the bazaar mailing list