[PATCH 2 of 2 stable] color: set _colormode to None when mode is unset (issue3895)

Kevin Bullock kbullock+mercurial at ringworld.org
Sat Apr 20 03:48:07 UTC 2013


On 19 Apr 2013, at 6:58 PM, Siddharth Agarwal wrote:

> # HG changeset patch
> # User Siddharth Agarwal <sid0 at fb.com>
> # Date 1366415830 25200
> #      Fri Apr 19 16:57:10 2013 -0700
> # Branch stable
> # Node ID a8b636b0dc16463b9845911f7c310ce6ebb6c402
> # Parent  f1a1080137afc080daae6f0cbfa255e1409a7ebb
> color: set _colormode to None when mode is unset (issue3895)
> 
> Previously, colorui assumed that it would only be called when mode wasn't
> None. 7ae12ce87594 changed that, so now colorui needs to care about whether it
> should colorize output.

Crewed this series, thanks.

I'd like to see an additional test here, though, that tests the "stdout isn't a TTY" case more directly in addition to the current --color=never test. We can test this with --config ui.formatted=False. _modesetup is complex enough (and our coverage here appears to be sparse enough) that I think it's warranted. Am I wrong?

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock




More information about the Mercurial-devel mailing list