[PATCH] color: enabled color support for export command (issue1507)

Martin Geisler martin at geisler.net
Sun Sep 2 08:29:32 CDT 2012

Gilles Moris <gilles.moris at free.fr> writes:

> On Thursday 30 August 2012 11:25:15 pm Matt Mackall wrote:
>> > color: enabled color support for export command (issue1507)
>> >
>> > The export command didn't output the diffs in color, even when
>> > color support was enabled. This patch fixes that by making the
>> > export command use the default ui.write method, instead of directly
>> > manipulating the ui.fout file object. Also added a test case to
>> > verify color output to test-export.t.
>> I guess this is ok. Historically, 'hg export' exists to work with
>> 'patch' or 'hg import', being pretty is not a goal. But I guess I
>> occasionally use 'hg export' to look at patches rather than 'hg log
>> -vpr'.
> I don't like that. Normally "color" is shut down for non tty output.
> But this increase the risk that export creates a non usable export
> patch if this detection fails for some reasons.
> We have "hg log -pvr" that does the job for coloring output, and "hg
> export" should be just for exports. I don't see the point of risking
> to break scripts when we already have a solution.

I think we need to decide if we trust the TTY detection or not. Being
afraid of unclear risks is not constructive -- either we have a bug or
we don't.

Martin Geisler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120902/6bca5d25/attachment.pgp>

More information about the Mercurial-devel mailing list