[bug] bundle creation problems
John Arbash Meinel
john at arbash-meinel.com
Mon Aug 14 16:51:49 BST 2006
Martin Pool wrote:
> On 11 Aug 2006, holger krekel <holger at merlinux.de> wrote:
>> Hi folks,
>>
>> while playing with bundle parsing, I noticed that
>>
>> bzr bundle -r 1..-1 --output=test.bundle
>>
>> on current bzr.dev (1912 revisions) fails with:
>>
>> ...
>> File "bzrlib/testament.py", line 144, in as_text_lines
>> return [line.encode('utf-8') for line in r]
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)
>>
>> where the 'line' in question is created by _revprops_to_lines
>> which encodes non-ascii characters in utf8 - and then the
>> attempt in as_text_lines to encode again fails (depends
>> on the locale default encoding). The attached patch fixes
>> this particular problem.
Well, at least to some respect, I already have submitted this bug:
https://launchpad.net/products/bzr/+bug/54723
I came across it a while ago.
His specific fix is probably the wrong one to make. Because he basically
skips doing any utf-8 encoding. And I think it depends more on whether
the internal stanza is encoding or not.
We will also have a bug during decoding. So I think we need a more
explicit set of tests that nested stanzas handle non-ascii characters.
>
> Thanks for that. Could you please also try to write a test that will
> trap this? It should be enough to just add one to test_testament that
> makes a revision with a non-ascii committer and message, and then
> generate a testament from it.
>
>> However, after applying this fix the above bundle creation
>> then leads to this problem:
>>
>> bzr: ERROR: Revision {john at arbash-meinel.com-20050709180338-33e3b5a778df9104} not
>> present in inventory.
>>
>> what to do about this?
>
> Bazaar repositories are allowed to contain references to revisions which
> aren't present in the repository -- these are called ghost revisions.
> When generating a bundle we should probably skip them - just in the
> appropriate loop, continue if the revision isn't there. This will need
> a test too. :-)
Yeah, I think the best thing is just to transmit the bundle as another
ghost. I don't think there is a lot more that we can do.
John
=:->
-------------- 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/20060814/96108e2d/attachment.pgp
More information about the bazaar
mailing list