|
|
@@ -26,6 +26,11 @@ class GitDataCollector(DataCollector):
|
|
26
|
26
|
self.get_loc_info()
|
|
27
|
27
|
self.get_author_info()
|
|
28
|
28
|
|
|
|
29
|
+ def xlate(self, name):
|
|
|
30
|
+ if name in self.conf['name_xlate']:
|
|
|
31
|
+ return self.conf['name_xlate'][name]
|
|
|
32
|
+ return name
|
|
|
33
|
+
|
|
29
|
34
|
def get_author_info(self):
|
|
30
|
35
|
# Per-author statistics
|
|
31
|
36
|
# defined for stamp, author only if author commited at this timestamp.
|
|
|
@@ -51,6 +56,7 @@ class GitDataCollector(DataCollector):
|
|
51
|
56
|
try:
|
|
52
|
57
|
oldstamp = stamp
|
|
53
|
58
|
(stamp, author) = (int(line[:pos]), line[pos + 1:])
|
|
|
59
|
+ author = self.xlate(author)
|
|
54
|
60
|
if oldstamp > stamp:
|
|
55
|
61
|
# clock skew, keep old timestamp to avoid having ugly graph
|
|
56
|
62
|
stamp = oldstamp
|
|
|
@@ -202,7 +208,7 @@ class GitDataCollector(DataCollector):
|
|
202
|
208
|
stamp = 0
|
|
203
|
209
|
timezone = parts[3]
|
|
204
|
210
|
author, mail = parts[4].split('<', 1)
|
|
205
|
|
- author = author.rstrip()
|
|
|
211
|
+ author = self.xlate(author.rstrip())
|
|
206
|
212
|
mail = mail.rstrip('>')
|
|
207
|
213
|
domain = '?'
|
|
208
|
214
|
if mail.find('@') != -1:
|
|
|
@@ -254,6 +260,7 @@ class GitDataCollector(DataCollector):
|
|
254
|
260
|
# author stats
|
|
255
|
261
|
if author not in self.authors:
|
|
256
|
262
|
self.authors[author] = Author()
|
|
|
263
|
+ self.authors[author].activity_by_day_and_hour[day][hour] += 1
|
|
257
|
264
|
# commits, note again that commits may be in any date order because of cherry-picking and patches
|
|
258
|
265
|
if not self.authors[author].last_commit_stamp:
|
|
259
|
266
|
self.authors[author].last_commit_stamp = stamp
|
|
|
@@ -395,6 +402,11 @@ class GitDataCollector(DataCollector):
|
|
395
|
402
|
a.date_first = date_first.strftime('%Y-%m-%d')
|
|
396
|
403
|
a.date_last = date_last.strftime('%Y-%m-%d')
|
|
397
|
404
|
a.timedelta = delta
|
|
|
405
|
+ for day in range(6):
|
|
|
406
|
+ for hour in range(24):
|
|
|
407
|
+ if day > 4 or hour < 8 or hour > 17:
|
|
|
408
|
+ a.extra_effort += a.activity_by_day_and_hour[day][hour]
|
|
|
409
|
+ a.extra_frac = (100 * float(a.extra_effort)) / a.commits
|
|
398
|
410
|
|
|
399
|
411
|
def getActiveDays(self):
|
|
400
|
412
|
return self.active_days
|
|
|
@@ -435,7 +447,9 @@ class GitDataCollector(DataCollector):
|
|
435
|
447
|
return self.revToDate('tags/' + tag)
|
|
436
|
448
|
|
|
437
|
449
|
def getTotalAuthors(self):
|
|
438
|
|
- return self.total_authors
|
|
|
450
|
+ # because we are equating names (see name_xlate), the total authors will be the number of
|
|
|
451
|
+ # elements in the authors dictionary rather than the count from the git log
|
|
|
452
|
+ return len(self.authors)
|
|
439
|
453
|
|
|
440
|
454
|
def getTotalCommits(self):
|
|
441
|
455
|
return self.total_commits
|