[PATCH] color: issue warning in yellow

Martin von Zweigbergk martinvonz at google.com
Mon Aug 20 14:14:23 EDT 2018


On Mon, Aug 20, 2018 at 9:26 AM Kyle Lippincott <spectral at google.com> wrote:

> Bright/bold yellow should be considered unavailable.  "Normal" yellow,
> which is closer to brown or maybe gold on many screens, is fine.
>

Ah, and we already use yellow for a few things (as you also pointed out).
Sorry I didn't even check that.


>   At Google, and I think other tools like clang, generally use magenta I
> believe, but I have no strong preference.  Keep in mind that ui.prompt is
> also yellow a couple lines below.
>

Good point about ui.prompt. Yellow seems like the obvious choice for
warnings, so do we want to change the color for the prompt?


>
> On Mon, Aug 20, 2018, 06:22 Martin von Zweigbergk <martinvonz at google.com>
> wrote:
>
>> I think most of us would be happy with this, but I seem to remember Kyle
>> always saying that it will be unreadable for users who use white background.
>>
>> On Aug 20, 2018 01:04, "Boris Feld" <boris.feld at octobus.net> wrote:
>>
>> # HG changeset patch
>> # User Boris Feld <boris.feld at octobus.net>
>> # Date 1534290303 -7200
>> #      Wed Aug 15 01:45:03 2018 +0200
>> # Node ID 4144148d7aba13ece916c6f735c791ca3d93a249
>> # Parent  c62184c6299c09d2e8e7be340f9aee138229cb86
>> # EXP-Topic color-warning
>> # Available At https://bitbucket.org/octobus/mercurial-devel/
>> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
>> 4144148d7aba
>> color: issue warning in yellow
>>
>> Using a different color for warning/error output help them to stand out
>> and
>> attract user attention. At Octobus we have been using this setting for
>> years
>> with good result.
>>
>> Now that `ui.error` are colored in red, it seems reasonable to color all
>> other
>> error output in yellow.
>>
>> diff --git a/mercurial/color.py b/mercurial/color.py
>> --- a/mercurial/color.py
>> +++ b/mercurial/color.py
>> @@ -119,6 +119,7 @@ except ImportError:
>>      'formatvariant.config.default': 'green',
>>      'formatvariant.default': '',
>>      'histedit.remaining': 'red bold',
>> +    'ui.warning': 'yellow',
>>      'ui.error': 'red',
>>      'ui.prompt': 'yellow',
>>      'log.changeset': 'yellow',
>> diff --git a/tests/test-pager.t b/tests/test-pager.t
>> --- a/tests/test-pager.t
>> +++ b/tests/test-pager.t
>> @@ -199,7 +199,7 @@ even though stdout is no longer a tty.
>>  An invalid pager command name is reported sensibly if we don't have to
>>  use shell=True in the subprocess call:
>>    $ hg log --limit 3 --config pager.pager=this-command-better-never-exist
>> -  missing pager command 'this-command-better-never-exist', skipping pager
>> +  \x1b[0;33mmissing pager command 'this-command-better-never-exist',
>> skipping pager\x1b[0m (esc)
>>    \x1b[0;33mchangeset:   10:46106edeeb38\x1b[0m (esc)
>>    tag:         tip
>>    user:        test
>> diff --git a/tests/test-status-color.t b/tests/test-status-color.t
>> --- a/tests/test-status-color.t
>> +++ b/tests/test-status-color.t
>> @@ -204,7 +204,7 @@ hg status:
>>  hg status modified added removed deleted unknown never-existed ignored:
>>
>>    $ hg status modified added removed deleted unknown never-existed
>> ignored
>> -  never-existed: * (glob)
>> +  \x1b[0;33mnever-existed: $ENOENT$\x1b[0m (esc)
>>    \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
>>    \x1b[0;31;1mR \x1b[0m\x1b[0;31;1mremoved\x1b[0m (esc)
>>    \x1b[0;36;1;4m! \x1b[0m\x1b[0;36;1;4mdeleted\x1b[0m (esc)
>> @@ -310,9 +310,9 @@ check 'status -q' and some combinations
>>  test unknown color
>>
>>    $ hg --config color.status.modified=periwinkle status
>> -  ignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)
>> -  ignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)
>> -  ignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)
>> +  \x1b[0;33mignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)\x1b[0m (esc)
>> +  \x1b[0;33mignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)\x1b[0m (esc)
>> +  \x1b[0;33mignoring unknown color/effect 'periwinkle' (configured in
>> color.status.modified)\x1b[0m (esc)
>>    M modified
>>    \x1b[0;32;1mA \x1b[0m\x1b[0;32;1madded\x1b[0m (esc)
>>    \x1b[0;32;1mA \x1b[0m\x1b[0;32;1mcopied\x1b[0m (esc)
>> @@ -376,8 +376,8 @@ test 'resolve -l'
>>    $ hg merge
>>    merging a
>>    merging b
>> -  warning: conflicts while merging a! (edit, then use 'hg resolve
>> --mark')
>> -  warning: conflicts while merging b! (edit, then use 'hg resolve
>> --mark')
>> +  \x1b[0;33mwarning: conflicts while merging a! (edit, then use 'hg
>> resolve --mark')\x1b[0m (esc)
>> +  \x1b[0;33mwarning: conflicts while merging b! (edit, then use 'hg
>> resolve --mark')\x1b[0m (esc)
>>    0 files updated, 0 files merged, 0 files removed, 2 files unresolved
>>    use 'hg resolve' to retry unresolved file merges or 'hg merge --abort'
>> to abandon
>>    [1]
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180820/c21373ca/attachment.html>


More information about the Mercurial-devel mailing list