[PATCH 0 of 2] don't send binary data to stdout when it's a tty (Issue2614)

Craig Leres leres at ee.lbl.gov
Sun Apr 10 14:42:19 CDT 2011


On 04/10/11 11:11, Matt Mackall wrote:
> On Sun, 2011-04-10 at 10:10 -0700, Craig Leres wrote:
>> The first patchset prevents "hg grep" from sending binary data to stdout
>> when it's a tty.
> 
> Sounds a lot like this patch that went in yesterday:
> 
> http://www.selenic.com/hg/rev/332e400764e5

Yes, it looks like there has been some duplicated effort. I guess I
(incorrectly?) assumed that owning the ticket meant I would be notified
if someone else started working on it. But I've also been lazy about
submitting my patchsets which I've had ready for weeks now.

The referenced patch looks like it re-reads files to determine if they
contain binary data. My patch does the binary() check at the point when
the contents of the file is already available and caches the results in
a dict.

It also changes the behavior when stdout is not a tty (which will
potentially break usage in scripts). My patch obeys ui.formatted().

Finally, my patch implements both the regular and --all cases.

		Craig


More information about the Mercurial-devel mailing list