There was a mistake in the calculation of comments in the blame module.

Whenever filtering of author or email was enabled, problems could arise
when calculating comments percentage. Did some reshuffling of the logic;
resolving it.
This commit is contained in:
Adam Waldenberg 2013-08-13 19:26:14 +02:00
parent c96d3c3ffe
commit cf0f40cc4d
1 changed files with 7 additions and 3 deletions

View File

@ -62,17 +62,21 @@ class BlameThread(threading.Thread):
for j in git_blame_r.readlines():
j = j.decode("utf-8", "replace")
if Blame.is_blame_line(j) and not (Blame.is_prior(j) and interval.get_since()):
if Blame.is_blame_line(j):
content = Blame.get_content(j)
(comments, is_inside_comment) = comment.handle_comment_block(is_inside_comment, self.extension, content)
if Blame.is_prior(j) and interval.get_since():
continue
email = Blame.get_author_email(j)
author = self.changes.get_latest_author_by_email(email)
content = Blame.get_content(j)
__blame_lock__.acquire() # Global lock used to protect calls from here...
if not filtering.set_filtered(author, "author") and not filtering.set_filtered(email, "email"):
if self.blames.get((author, self.filename), None) == None:
self.blames[(author, self.filename)] = BlameEntry()
(comments, is_inside_comment) = comment.handle_comment_block(is_inside_comment, self.extension, content)
self.blames[(author, self.filename)].comments += comments
self.blames[(author, self.filename)].rows += 1