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

Sean Farley sean at farley.io
Mon Jan 9 14:49:36 EST 2017


# HG changeset patch
# User Sean Farley <sean at 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.

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')]


More information about the Mercurial-devel mailing list