Patchwork [1,of,3] color: document that labels are used for colourising text

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Sept. 3, 2014, 1:39 p.m.
Message ID <c1b3584876e7a2e3001c.1409751546@Iris>
Download mbox | patch
Permalink /patch/5689/
State Accepted
Headers show

Comments

Jordi Gutiérrez Hermoso - Sept. 3, 2014, 1:39 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1408916136 14400
#      Sun Aug 24 17:35:36 2014 -0400
# Node ID c1b3584876e7a2e3001ce1324adde0fb94d23804
# Parent  e3045cd4dc22cbd9cbf0c3a22756b4e409d54627
color: document that labels are used for colourising text

It is a deeply hidden secret that it's possible to colorise so many
things with so many different labels. This is an attempt to document
this. The text is a bit long, but it seems as short as can be while
documenting everything. Perhaps it should be hidden under a --verbose
option.
Pierre-Yves David - Sept. 18, 2014, 12:12 a.m.
please use V# flag when resending series. this is apprently V3…

On 09/03/2014 06:39 AM, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1408916136 14400
> #      Sun Aug 24 17:35:36 2014 -0400
> # Node ID c1b3584876e7a2e3001ce1324adde0fb94d23804
> # Parent  e3045cd4dc22cbd9cbf0c3a22756b4e409d54627
> color: document that labels are used for colourising text
>
> It is a deeply hidden secret that it's possible to colorise so many
> things with so many different labels. This is an attempt to document
> this. The text is a bit long, but it seems as short as can be while
> documenting everything. Perhaps it should be hidden under a --verbose
> option.
>
> diff --git a/hgext/color.py b/hgext/color.py
> --- a/hgext/color.py
> +++ b/hgext/color.py
> @@ -19,7 +19,16 @@ terminal codes used to change color and
>   available, then effects are rendered with the ECMA-48 SGR control
>   function (aka ANSI escape codes).
>
> -Default effects may be overridden from your configuration file::
> +Text receives color effects depending on the labels that it has. Many
> +default Mercurial commands emit labelled text. You can also define
> +your own labels in templates using the label function, see :hg:`help
> +templates`. A single portion of text may have more than one label. In
> +that case, effects given to the last label will override any other
> +effects. This includes the special "none" effect, which nullifies
> +other effects.
> +
> +The following are the default effects for some default labels. Default
> +effects may be overridden from your configuration file::
>
>     [color]
>     status.modified = blue bold underline red_background
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -19,7 +19,16 @@  terminal codes used to change color and 
 available, then effects are rendered with the ECMA-48 SGR control
 function (aka ANSI escape codes).
 
-Default effects may be overridden from your configuration file::
+Text receives color effects depending on the labels that it has. Many
+default Mercurial commands emit labelled text. You can also define
+your own labels in templates using the label function, see :hg:`help
+templates`. A single portion of text may have more than one label. In
+that case, effects given to the last label will override any other
+effects. This includes the special "none" effect, which nullifies
+other effects.
+
+The following are the default effects for some default labels. Default
+effects may be overridden from your configuration file::
 
   [color]
   status.modified = blue bold underline red_background