# HG changeset patch # User Peter Hosey # Date 1218436148 25200 # Node ID 9eda9139d627daded5f74728fb5f3326481719cb # Parent 44f86539d245e97295c01cb54d83baf358d37b75 Added support for hunk start markers (@@…@@). For these, we set the whole line in reverse video, in the same color we use for index lines. diff --git a/diff-colorize.py b/diff-colorize.py --- a/diff-colorize.py +++ b/diff-colorize.py @@ -8,6 +8,7 @@ END_REVERSE_FORMAT = '\033[27m' INDEX_COLOR = 32 REMOVED_COLOR = 203 ADDED_COLOR = 2 +HUNK_START_COLOR = 32 class OrderedDict(dict): def __init__(self, input=None): @@ -57,6 +58,11 @@ prefixes['+'] = ( ) prefixes['Index: '] = COLOR_FORMAT % (INDEX_COLOR,) + 'Index: ' prefixes['diff --git '] = COLOR_FORMAT % (INDEX_COLOR,) + 'diff --git ' +prefixes['@@'] = ( + COLOR_FORMAT % (HUNK_START_COLOR,) + + BEGIN_REVERSE_FORMAT + + '@@' +) import sys import fileinput