[BUG] bundle cannot handle binary files

John Arbash Meinel john at arbash-meinel.com
Fri Jul 7 23:19:55 BST 2006

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

Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list