[MERGE REVIEW] Binary file handling
aaron.bentley at utoronto.ca
Sun Apr 16 18:51:32 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
This patch adds support for binary file handling in diff and merge.
That is, diffing a binary file will produce 'Binary files differ'.
Text merges won't be performed on binary files-- if a scalar merge can't
be performed, foo.BASE, foo.THIS and foo.OTHER will be emitted, with no
foo. (foo.OTHER will be versioned).
Binary files are defined as files containing the NUL character (\x00) in
their first 1024 bytes. Reportedly, this is the heuristic used by diff.
~ This does, unfortunately, mean that UTF-16 files will be treated as
It is tempting to test for ESC as well, since that would prevent bzr
diff from messing up the user's terminal. Text files containing ESC are
relatively rare, but they do exist, e.g. shell scripts that set terminal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 18029 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060416/9e2d272b/attachment.bin
More information about the bazaar