Patchwork [3,of,8,git-diff] patch: add label for coloring the index extended header

login
register
mail settings
Submitter Sean Farley
Date Jan. 9, 2017, 7:49 p.m.
Message ID <8799dd0f3c4849ab5f46.1483991376@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/18149/
State Accepted
Headers show

Comments

Sean Farley - Jan. 9, 2017, 7:49 p.m.
# HG changeset patch
# User Sean Farley <sean@farley.io>
# Date 1483988385 28800
#      Mon Jan 09 10:59:45 2017 -0800
# Node ID 8799dd0f3c4849ab5f468f2343af4c108ed22e72
# Parent  95c9da9342914bda2208138af58a38eeaed859b4
patch: add label for coloring the index extended header

Just like the summary says, this will colorize the:

  index 3d3ba4b65e11..57274a0f46b2 100644

line in the diff output.

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2341,10 +2341,11 @@  def difflabel(func, *args, **kw):
                     ('copy', 'diff.extended'),
                     ('rename', 'diff.extended'),
                     ('old', 'diff.extended'),
                     ('new', 'diff.extended'),
                     ('deleted', 'diff.extended'),
+                    ('index', 'diff.extended'),
                     ('---', 'diff.file_a'),
                     ('+++', 'diff.file_b')]
     textprefixes = [('@', 'diff.hunk'),
                     ('-', 'diff.deleted'),
                     ('+', 'diff.inserted')]