|
|
@@ -74,6 +74,18 @@ def getkeyssortedbyvalues(dict):
|
|
74
|
74
|
def getkeyssortedbyvaluekey(d, key):
|
|
75
|
75
|
return map(lambda el : el[1], sorted(map(lambda el : (d[el][key], el), d.keys())))
|
|
76
|
76
|
|
|
|
77
|
+def getstatsummarycounts(line):
|
|
|
78
|
+ numbers = re.findall('\d+', line)
|
|
|
79
|
+ if len(numbers) == 1:
|
|
|
80
|
+ # neither insertions nor deletions: may probably only happen for "0 files changed"
|
|
|
81
|
+ numbers.append(0);
|
|
|
82
|
+ numbers.append(0);
|
|
|
83
|
+ elif len(numbers) == 2 and line.find('(+)') != -1:
|
|
|
84
|
+ numbers.append(0); # only insertions were printed on line
|
|
|
85
|
+ elif len(numbers) == 2 and line.find('(-)') != -1:
|
|
|
86
|
+ numbers.insert(1, 0); # only deletions were printed on line
|
|
|
87
|
+ return numbers
|
|
|
88
|
+
|
|
77
|
89
|
VERSION = 0
|
|
78
|
90
|
def getversion():
|
|
79
|
91
|
global VERSION
|
|
|
@@ -456,7 +468,7 @@ class GitDataCollector(DataCollector):
|
|
456
|
468
|
continue
|
|
457
|
469
|
|
|
458
|
470
|
# <stamp> <author>
|
|
459
|
|
- if line.find('files changed,') == -1:
|
|
|
471
|
+ if re.search('files? changed', line) == None:
|
|
460
|
472
|
pos = line.find(' ')
|
|
461
|
473
|
if pos != -1:
|
|
462
|
474
|
try:
|
|
|
@@ -478,7 +490,8 @@ class GitDataCollector(DataCollector):
|
|
478
|
490
|
else:
|
|
479
|
491
|
print 'Warning: unexpected line "%s"' % line
|
|
480
|
492
|
else:
|
|
481
|
|
- numbers = re.findall('\d+', line)
|
|
|
493
|
+ numbers = getstatsummarycounts(line)
|
|
|
494
|
+
|
|
482
|
495
|
if len(numbers) == 3:
|
|
483
|
496
|
(files, inserted, deleted) = map(lambda el : int(el), numbers)
|
|
484
|
497
|
total_lines += inserted
|
|
|
@@ -510,7 +523,7 @@ class GitDataCollector(DataCollector):
|
|
510
|
523
|
continue
|
|
511
|
524
|
|
|
512
|
525
|
# <stamp> <author>
|
|
513
|
|
- if line.find('files changed,') == -1:
|
|
|
526
|
+ if re.search('files? changed', line) == None:
|
|
514
|
527
|
pos = line.find(' ')
|
|
515
|
528
|
if pos != -1:
|
|
516
|
529
|
try:
|
|
|
@@ -536,7 +549,8 @@ class GitDataCollector(DataCollector):
|
|
536
|
549
|
else:
|
|
537
|
550
|
print 'Warning: unexpected line "%s"' % line
|
|
538
|
551
|
else:
|
|
539
|
|
- numbers = re.findall('\d+', line)
|
|
|
552
|
+ numbers = getstatsummarycounts(line);
|
|
|
553
|
+
|
|
540
|
554
|
if len(numbers) == 3:
|
|
541
|
555
|
(files, inserted, deleted) = map(lambda el : int(el), numbers)
|
|
542
|
556
|
else:
|