improve git diff support

--HG--
branch : pmacs2
This commit is contained in:
Erik Osheim 2010-11-18 12:36:25 -05:00
parent b2c036479f
commit 6e02ce8b4d
1 changed files with 4 additions and 2 deletions

View File

@ -4,7 +4,7 @@ from subprocess import Popen, PIPE, STDOUT
import buffer, default, dirutil, lex, regex, util, window
from point import Point
import buffer.colors
from method.vc import VcBlame, VcRevView, VcBase
from method.vc import VcBlame, VcRevView, VcBase, VcException
from method import Method, Argument, arg
@ -176,7 +176,7 @@ class GitBlame(VcBlame):
'''show blame output for the current version in SVN'''
# rev, user, date, [time], [timezone], [date-str], content
num_fields = 3
line_re = re.compile(r'^([0-9a-f]+) \(([a-zA-Z0-9_]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$')
line_re = re.compile(r'^\^*([0-9a-f]+) \(([a-zA-Z0-9_]+|Not Committed Yet) +([-0-9]+) [:0-9]+ +[-\+]\d{4} +\d+\) (.*)\n$')
prefix_fmt = '[g:d:*]%*s [c:d:*]%-*s [b:d:*]%*s[d:d:*]'
pretest_err_msg = 'Git is not installed'
_is_method = True
@ -188,6 +188,8 @@ class GitBlame(VcBlame):
fields = list(groups[:-1])
if fields[1] == 'Not Committed Yet':
fields[1] = ''
if fields[0] == '00000000':
fields[0] = ''
return {'fields': fields, 'content': groups[-1], 'tokens': []}
def _pretest(self):
return has_git