[bug] bundle creation problems

Martin Pool mbp at canonical.com
Mon Aug 14 10:36:22 BST 2006


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. 

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.  :-)

-- 
Martin




More information about the bazaar mailing list