[BUG] bundle cannot handle binary files

Alexander Belchenko bialix at ukr.net
Sat Jul 8 11:46:23 BST 2006


John Arbash Meinel пишет:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Alexander Belchenko wrote:
> 
>>I post about this bug earlier (see my recent post with subject line
>>"win32: merging bundle error"). Now I want to say again because I
>>localize problem.
>>
>>If bundle contains binary file as base64-encoded string then this bundle
>>cannot be pulled or merged in. I can reproduce this with my bzr.ico
>>(attached). Bundle (binary.patch) that contain this file also attached.
>>
>>Steps to reproduce:
>>
>>bzr init a
>>bzr branch a b
>>cd a
>>copy bzr.ico into this directory
>>bzr add
>>bzr ci -m bzr.ico
>>bzr bundle -r0..1 --output=binary.patch
>>cd ../b
>>move biinary.patch to this directory
>>bzr merge binary.patch
>>
>>This traceback was printed by most recent bzr.dev. I don't think it's a
>>windows-specific.
>>
> 
> 
> This seems to be win32 specific, because I just did this on my linux box:
> 
> 
> $ bzr init a
> $ bzr branch a b
> Branched 0 revision(s).
> $ cd a/
> $ cp ../../patches/bzr.ico .
> $ bzr add
> added bzr.ico
> $ bzr commit -m 'binary'
> $ bzr bundle -r 0..1 --output=binary.patch
> $ cd ../b/
> $ bzr merge ../a/binary.patch
> $ bzr st
> added:
>   bzr.ico
> pending merges:
>   John Arbash Meinel 2006-07-07 binary
> 
> That said, I do get a failure when trying to merge your binary.patch. I
> don't know what the specific problem is. But it might just be that win32
> is failing to create correct bundles for binary files. (It might also be
> that win32 is incorrectly versioning binary files). But looking at the
> various code paths, we should be opening the file in 'rb'. Which
> shouldn't be causing problems.
> We do split the file on newlines, but it should be a lossless effect. If
> it wasn't we would be having problems elsewhere.
> 
> I also tried these exact steps on a win32 machine, and got the same
> results. So something is wrong with your patch, but it doesn't seem to
> be a problem with the current bzr.dev.
> 
> I'm not sure what else to tell you. I even checked that the icon looked
> reasonable (and opened in an image viewer). So everything seems to be okay.

I manually extract base-64 encoded bzr.ico's diff from my bundle. And 
then decode it from base64. After that I save decoded string to file
binary.diff (attached).

After that I copy this diff to empty directory and run:

D:\user\MyCode\bzr\__test\b>patch -p0 --binary < binary.diff
patching file bzr.ico

And as result I have normal bzr.ico in this directory.

So, when I run all steps manually I ends with correct result.

What it should means?

--
Alexander

-------------- next part --------------
A non-text attachment was scrubbed...
Name: binary.diff
Type: application/octet-stream
Size: 3730 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060708/6c5b419c/attachment.obj 


More information about the bazaar mailing list