[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 12:10:26 CDT 2011


The first patchset prevents "hg grep" from sending binary data to stdout
when it's a tty.

The old hg grep output behaviour is kept when stdout is not a tty or
when the (new) -a/--text flag is used. Also, warnings are sent to stderr
unlike gnu grep which uses stdout.

In the case where hg grep is used in like gnu grep (the first matching
revision), one warning is displayed per binary file that matches the
search pattern.

The other case is where hg grep is used to search multiple revisions with
-all or --follow. In this case one warning per file+rev is output and the
per match output lines are the same as before except the last part which
consists of the seperator (usually ':') and matching text is suppressed.

examples:

hg grep -f --all -nu port port2
hg grep --all port port
hg grep -r5 port port
hg grep port port

The second patchset adds -a/--text to grep.

		Craig


More information about the Mercurial-devel mailing list