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

Jordi Gutiérrez Hermoso jordigh at octave.org
Mon Aug 25 16:07:19 CDT 2014


# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh at octave.org>
# Date 1408916136 14400
#      Sun Aug 24 17:35:36 2014 -0400
# Node ID c5f6568355f263842344e08dd2b74051c869324d
# Parent  258f682b167cdbbbc65eeb0ad37a824e6650c42f
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 and give an option to view the labels.

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -19,7 +19,12 @@ 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`.
+
+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


More information about the Mercurial-devel mailing list