This is an archive of the discontinued Mercurial Phabricator instance.

color: respect HGPLAINEXCEPT=color to allow colors while scripting (issue5749)
ClosedPublic

Authored by durin42 on Nov 28 2017, 1:28 PM.

Details

Summary

I'd also like --color=always on the command-line to override HGPLAIN=1
et al, but that's more work, and this seems like a better fix. We've
got a fair number of programs that actually want to automate hg and
get colored output to users, so they should set HGPLAINEXCEPT=alias
(what we usually recommend), but this has been breaking them because
they then lose color.

.. feature::

The ``HGPLAINEXCEPT`` environment variable can now include ``color``
to allow automatic output colorization in otherwise automated
environments.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Nov 28 2017, 1:28 PM
durin42 retitled this revision from color: respect HGPLAINEXCEPT=color to allow colors in otherwise-plain settings to color: respect HGPLAINEXCEPT=color to allow colors while scripting (issue5749).Nov 28 2017, 1:29 PM
xalep added a subscriber: xalep.Nov 29 2017, 3:35 AM

You could also add color to the list of values described for HGPLAINEXCEPT in mercurial/help/environment.txt

durin42 updated this revision to Diff 4018.Nov 30 2017, 4:26 PM
In D1532#26006, @xalep wrote:

You could also add color to the list of values described for HGPLAINEXCEPT in mercurial/help/environment.txt

Nice catch, thanks!

yuja accepted this revision.Dec 1 2017, 8:24 AM
This revision is now accepted and ready to land.Dec 1 2017, 8:24 AM
This revision was automatically updated to reflect the committed changes.