Better limit the results in per user reports.

This commit is contained in:
Michael Still 2014-03-06 17:13:55 +11:00
parent dbf763b938
commit 24382e8f38
1 changed files with 17 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/python
import copy
import datetime
import json
import sys
@ -26,6 +27,9 @@ def report(project_filter, user_filter, prefix):
user_filter_new = ['Jenkins']
user_filter_new.extend(user_filter)
user_filter = user_filter_new
user_filter_without_jenkins = copy.copy(user_filter)
user_filter_without_jenkins.remove('Jenkins')
# This is more complicated than it looks because we need to handle
# patchsets which are uploaded so rapidly that older patchsets aren't
@ -65,6 +69,19 @@ def report(project_filter, user_filter, prefix):
if valid_for < datetime.timedelta(hours=3):
continue
matched_authors = 0
for author in patchsets[number][patch]:
if author == '__created__':
continue
if author not in user_filter_without_jenkins:
continue
matched_authors += 1
if matched_authors == 0:
continue
valid_patches.append(patch)
total_patches += len(valid_patches)