Fix inconsistent behavior with -f "**" (Fixes #95).

Improved by taking advantage of the detected file types during the first
pass in the changes module.
This commit is contained in:
Adam Waldenberg 2016-02-03 12:47:28 +01:00
parent fbb9115666
commit 738d6a1195
2 changed files with 8 additions and 2 deletions

View File

@ -24,6 +24,7 @@ from outputable import Outputable
from changes import FileDiff from changes import FileDiff
import comment import comment
import datetime import datetime
import extensions
import filtering import filtering
import format import format
import gravatar import gravatar
@ -142,11 +143,13 @@ class Blame:
row = row.encode("latin-1", "replace") row = row.encode("latin-1", "replace")
row = row.decode("utf-8", "replace").strip("\"").strip("'").strip() row = row.decode("utf-8", "replace").strip("\"").strip("'").strip()
if FileDiff.is_valid_extension(row) and not filtering.set_filtered(FileDiff.get_filename(row)): if FileDiff.get_extension(row) in extensions.get_located() and not \
filtering.set_filtered(FileDiff.get_filename(row)):
blame_command = filter(None, ["git", "blame", "--line-porcelain", "-w"] + \ blame_command = filter(None, ["git", "blame", "--line-porcelain", "-w"] + \
(["-C", "-C", "-M"] if hard else []) + (["-C", "-C", "-M"] if hard else []) +
[interval.get_since(), interval.get_ref(), "--", row]) [interval.get_since(), interval.get_ref(), "--", row])
thread = BlameThread(useweeks, changes, blame_command, FileDiff.get_extension(row), self.blames, row.strip()) thread = BlameThread(useweeks, changes, blame_command, FileDiff.get_extension(row),
self.blames, row.strip())
thread.daemon = True thread.daemon = True
thread.start() thread.start()

View File

@ -42,6 +42,9 @@ def add_located(string):
else: else:
__located_extensions__.add(string) __located_extensions__.add(string)
def get_located():
return __located_extensions__
EXTENSIONS_INFO_TEXT = N_("The extensions below were found in the repository history") EXTENSIONS_INFO_TEXT = N_("The extensions below were found in the repository history")
EXTENSIONS_MARKED_TEXT = N_("(extensions used during statistical analysis are marked)") EXTENSIONS_MARKED_TEXT = N_("(extensions used during statistical analysis are marked)")