Patchwork color: document the possibility to colourise tabs in diffs

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Oct. 3, 2014, 8:19 p.m.
Message ID <7b18366b12d6081bc78b.1412367573@Iris>
Download mbox | patch
Permalink /patch/6096/
State Accepted
Headers show

Comments

Jordi Gutiérrez Hermoso - Oct. 3, 2014, 8:19 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1408562377 14400
#      Wed Aug 20 15:19:37 2014 -0400
# Node ID 7b18366b12d6081bc78bb2beb98bdcb71018ef69
# Parent  78c916f24dd99a56e4c29153a5df3bd7d1c40edd
color: document the possibility to colourise tabs in diffs

This is a no-op change that simply suggests that tabs can be
colourised, but defaults to no colour effects for tabs. This
complements cset c343557a8442.

Like the similar effects for phases from f8e2aebbb24c, we set the
default effects to '' instead of None, so that this is a true noop
change. Otherwise, the diff.tab effect would override (i.e.
neutralise) the effect of the surrounding label.
Augie Fackler - Oct. 7, 2014, 5:15 p.m.
On Fri, Oct 03, 2014 at 04:19:33PM -0400, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1408562377 14400
> #      Wed Aug 20 15:19:37 2014 -0400
> # Node ID 7b18366b12d6081bc78bb2beb98bdcb71018ef69
> # Parent  78c916f24dd99a56e4c29153a5df3bd7d1c40edd
> color: document the possibility to colourise tabs in diffs

This was pushed as b07fd3ac8882.

>
> This is a no-op change that simply suggests that tabs can be
> colourised, but defaults to no colour effects for tabs. This
> complements cset c343557a8442.
>
> Like the similar effects for phases from f8e2aebbb24c, we set the
> default effects to '' instead of None, so that this is a true noop
> change. Otherwise, the diff.tab effect would override (i.e.
> neutralise) the effect of the surrounding label.
>
> diff --git a/hgext/color.py b/hgext/color.py
> --- a/hgext/color.py
> +++ b/hgext/color.py
> @@ -11,7 +11,7 @@ This extension modifies the status and r
>  to their output to reflect file status, the qseries command to add
>  color to reflect patch status (applied, unapplied, missing), and to
>  diff-related commands to highlight additions, removals, diff headers,
> -and trailing whitespace.
> +tabs, and trailing whitespace.
>
>  Other effects in addition to color, like bold and underlined text, are
>  also available. By default, the terminfo database is used to find the
> @@ -61,6 +61,7 @@ effects may be overridden from your conf
>    diff.deleted = red
>    diff.inserted = green
>    diff.changed = white
> +  diff.tab =
>    diff.trailingwhitespace = bold red_background
>
>    # Blank so it inherits the style of the surrounding label
> @@ -279,6 +280,7 @@ except ImportError:
>             'diff.file_b': 'green bold',
>             'diff.hunk': 'magenta',
>             'diff.inserted': 'green',
> +           'diff.tab': '',
>             'diff.trailingwhitespace': 'bold red_background',
>             'changeset.public' : '',
>             'changeset.draft' : '',
> _______________________________________________
> 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
@@ -11,7 +11,7 @@  This extension modifies the status and r
 to their output to reflect file status, the qseries command to add
 color to reflect patch status (applied, unapplied, missing), and to
 diff-related commands to highlight additions, removals, diff headers,
-and trailing whitespace.
+tabs, and trailing whitespace.
 
 Other effects in addition to color, like bold and underlined text, are
 also available. By default, the terminfo database is used to find the
@@ -61,6 +61,7 @@  effects may be overridden from your conf
   diff.deleted = red
   diff.inserted = green
   diff.changed = white
+  diff.tab =
   diff.trailingwhitespace = bold red_background
 
   # Blank so it inherits the style of the surrounding label
@@ -279,6 +280,7 @@  except ImportError:
            'diff.file_b': 'green bold',
            'diff.hunk': 'magenta',
            'diff.inserted': 'green',
+           'diff.tab': '',
            'diff.trailingwhitespace': 'bold red_background',
            'changeset.public' : '',
            'changeset.draft' : '',