[PATCH 3 of 3] color: document that changeset phases have labels

Jordi Gutiérrez Hermoso jordigh at octave.org
Wed Sep 3 08:39:08 CDT 2014


# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh at octave.org>
# Date 1408915648 14400
#      Sun Aug 24 17:27:28 2014 -0400
# Node ID ee01f03638e59043f9bbc81481e83fe470142326
# Parent  cfa2b9f3d8b7e58be5422a2c5e3ee79393955303
color: document that changeset phases have labels

It's very useful to be able to colourise csets according to their
phases. There was no indication anywhere in the docs that this is
possible.

We use e.g. `changeset.secret = ` instead of `changeset.secret
='none'`, because otherwise this is a BC: it would nullify the effects
given to log.changeset label that usually surrounds the
changeset.{phase} labels. Specifying the label without any effect
instead of 'none' is a true no-op change and purely documentation.

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -64,6 +64,11 @@ effects may be overridden from your conf
   diff.tab = none
   diff.trailingwhitespace = bold red_background
 
+  # Blank so it inherits the style of the surrounding label
+  changeset.public =
+  changeset.draft =
+  changeset.secret =
+
   resolve.unresolved = red bold
   resolve.resolved = green bold
 
@@ -277,6 +282,9 @@ except ImportError:
            'diff.inserted': 'green',
            'diff.tab': 'none',
            'diff.trailingwhitespace': 'bold red_background',
+           'changeset.public' : '',
+           'changeset.draft' : '',
+           'changeset.secret' : '',
            'diffstat.deleted': 'red',
            'diffstat.inserted': 'green',
            'histedit.remaining': 'red bold',


More information about the Mercurial-devel mailing list