mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-27 18:01:30 +02:00
Revert "guard against exceptions when commits is None due to extension filtering"
This reverts commit a723313691
.
This commit is contained in:
parent
e58bf96d1a
commit
23801ce719
@ -160,7 +160,6 @@ class ChangesThread(threading.Thread):
|
|||||||
filtering.set_filtered(commit.sha, "message")):
|
filtering.set_filtered(commit.sha, "message")):
|
||||||
is_filtered = True
|
is_filtered = True
|
||||||
|
|
||||||
if commit is not None:
|
|
||||||
if FileDiff.is_filediff_line(j) and not \
|
if FileDiff.is_filediff_line(j) and not \
|
||||||
filtering.set_filtered(FileDiff.get_filename(j)) and not is_filtered:
|
filtering.set_filtered(FileDiff.get_filename(j)) and not is_filtered:
|
||||||
extensions.add_located(FileDiff.get_extension(j))
|
extensions.add_located(FileDiff.get_extension(j))
|
||||||
@ -199,14 +198,18 @@ class Changes(object):
|
|||||||
first_hash = ""
|
first_hash = ""
|
||||||
|
|
||||||
for i, entry in enumerate(lines):
|
for i, entry in enumerate(lines):
|
||||||
|
if i % CHANGES_PER_THREAD == CHANGES_PER_THREAD - 1:
|
||||||
entry = entry.decode("utf-8", "replace").strip()
|
entry = entry.decode("utf-8", "replace").strip()
|
||||||
second_hash = entry
|
second_hash = entry
|
||||||
ChangesThread.create(hard, self, first_hash, second_hash, i)
|
ChangesThread.create(hard, self, first_hash, second_hash, i)
|
||||||
if i % CHANGES_PER_THREAD == CHANGES_PER_THREAD - 1:
|
|
||||||
first_hash = entry + ".."
|
first_hash = entry + ".."
|
||||||
|
|
||||||
if format.is_interactive_format():
|
if format.is_interactive_format():
|
||||||
terminal.output_progress(progress_text, i, len(lines))
|
terminal.output_progress(progress_text, i, len(lines))
|
||||||
|
else:
|
||||||
|
entry = entry.decode("utf-8", "replace").strip()
|
||||||
|
second_hash = entry
|
||||||
|
ChangesThread.create(hard, self, first_hash, second_hash, i)
|
||||||
|
|
||||||
# Make sure all threads have completed.
|
# Make sure all threads have completed.
|
||||||
for i in range(0, NUM_THREADS):
|
for i in range(0, NUM_THREADS):
|
||||||
@ -217,22 +220,15 @@ class Changes(object):
|
|||||||
__thread_lock__.release()
|
__thread_lock__.release()
|
||||||
|
|
||||||
self.commits = [item for sublist in self.commits for item in sublist]
|
self.commits = [item for sublist in self.commits for item in sublist]
|
||||||
flatten = lambda l: [item for sublist in l for item in sublist]
|
|
||||||
self.commits = [x for x in flatten(self.commits) if x is not None]
|
|
||||||
|
|
||||||
if self.commits:
|
if len(self.commits) > 0:
|
||||||
first = self.commits[0]
|
if interval.has_interval() and len(self.commits) > 0:
|
||||||
last = self.commits[-1]
|
interval.set_ref(self.commits[-1].sha)
|
||||||
|
|
||||||
if first and last:
|
self.first_commit_date = datetime.date(int(self.commits[0].date[0:4]), int(self.commits[0].date[5:7]),
|
||||||
if interval.has_interval() and last:
|
int(self.commits[0].date[8:10]))
|
||||||
interval.set_ref(last.sha)
|
self.last_commit_date = datetime.date(int(self.commits[-1].date[0:4]), int(self.commits[-1].date[5:7]),
|
||||||
self.first_commit_date = self.get_commit_date(first)
|
int(self.commits[-1].date[8:10]))
|
||||||
self.last_commit_date = self.get_commit_date(last)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_commit_date(cls, commit):
|
|
||||||
return datetime.date(int(commit.date[0:4]), int(commit.date[5:7]), int(commit.date[8:10]))
|
|
||||||
|
|
||||||
def __iadd__(self, other):
|
def __iadd__(self, other):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user