The blame module was not behaving quite right when used with "--since".

It was not taking the caret (^) character into consideration when --since
was being specified, something which resulted in an excess of attributed
rows.

With this easy fix, the behavior should now be "correct".
This commit is contained in:
Adam Waldenberg 2013-08-13 15:26:42 +02:00
parent e7d69d78aa
commit c96d3c3ffe
1 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class BlameThread(threading.Thread):
for j in git_blame_r.readlines():
j = j.decode("utf-8", "replace")
if Blame.is_blame_line(j):
if Blame.is_blame_line(j) and not (Blame.is_prior(j) and interval.get_since()):
email = Blame.get_author_email(j)
author = self.changes.get_latest_author_by_email(email)
content = Blame.get_content(j)
@ -120,6 +120,10 @@ class Blame:
def is_blame_line(string):
return string.find(" (") != -1
@staticmethod
def is_prior(string):
return string[0] == "^"
@staticmethod
def get_author_email(string):
author_email = re.search(" \((.*?)\d\d\d\d-\d\d-\d\d", string)