[MERGE] Bugfix #55276: on win32 cat, bundle and diff commands provide binary output without mangling line-endings

John Arbash Meinel john at arbash-meinel.com
Mon Dec 18 20:03:27 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Alexander Belchenko ?8H5B:

...

> 
> After inspecting attributes of all built-ins non-hidden command
> I see that only 2 commands have exact encoding type: diff and version-info.
> 
> I don't think that parsing output of version-info will be difficult
> with CRLF line-endings, so I think this command don't require binary
> stdout on win32.
> 
> Alexander

'cat' should definitely be "exact", I think I just didn't get that far
when updating all of the commands.

Anything that outputs specific bytes should probably be 'exact'. So
'cat-revision' should be exact (and actually has a comment stating that).

Strictly, 'exact' meant that the function that will be writing will
handle encoding. So it should not be writing Unicode, but only
bytestreams. AIUI, rio is defined as being utf-8 encoded, so it has to
have 'exact' output, or it would try to decode from Ascii to a Unicode
string, and since it was decoding utf-8, it would puke.

So exact's original definition didn't have to deal with line ending
conversion, just encoding.

For something like 'version_info' it could really go either way. Though
I personally would prefer to not mess with a rio output.

I would actually be fine with 'exact' => 'binary'. Especially because it
simplifies the rest.

I'm not 100% happy with the encoding_type work I did, it seems to only
be a partial fix, so I would rather see a more intelligent output class.
Either going through bzrlib.ui, or I would prefer it to be passed
around, like we are already doing with a file output.

John
=:->


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFhvQPJdeBCYSNAAMRApDJAKC9aNDhRnv52VE8h2JHu+q6OD6kUQCeO6JZ
H5o3gPFAAEzVleMVjk8snD8=
=Ipqj
-----END PGP SIGNATURE-----




More information about the bazaar mailing list