[MERGE] Readable and properly encoded diff headers

John Arbash Meinel john at arbash-meinel.com
Tue Aug 15 15:37:41 BST 2006

Aaron Bentley wrote:
> Adeodato Simó wrote:
>>> The attached patch changes %r to '%s' in the headers, and also encodes
>>> the filenames in the proper encoding, not hardcoded 'utf8'.
> I don't think we should assume that the destination is a terminal.  For
> example, I believe this functionality is invoked by bzr-gtk's gdiff, and
> so changing it to something other than utf-8 might be a regression.
> So I think the default should remain utf-8, but cmd_diff should override
> it to cmd_diff.outf.
> Aaron

I think what we need is for 'show_diff_trees' to take the path_encoding
parameter, and pass it down the line. Rather than have it detected in

And then 'cmd_diff' can set path_encoding = osutils.terminal_encoding().

'self.outf' for cmd_diff is setup *without* encoding, because we don't
want to silently transcode the contents of the file. What I would really
like is to have a 'do not accept unicode' file-like object when

The to_file should definitely be self.outf. And it would be possible for
self.outf to have an encoding wrapper, and to write out the paths in
unicode. But I feel it leaves us open to a bug when writing something
else as part of 'diff'.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060815/d81e747b/attachment.pgp 

More information about the bazaar mailing list