|
|
@@ -249,13 +249,12 @@ class GitDataCollector(DataCollector):
|
|
249
|
249
|
# TODO Optimize this, it's the worst bottleneck
|
|
250
|
250
|
# outputs "<stamp> <files>" for each revision
|
|
251
|
251
|
self.files_by_stamp = {} # stamp -> files
|
|
252
|
|
- lines = getpipeoutput(['git-rev-list --pretty=format:"%at %H" HEAD', 'grep -v ^commit']).strip().split('\n')
|
|
253
|
|
- #'sh while read line; do set $line; echo "$1 $(git-ls-tree -r "$2" |wc -l)"; done')).split('\n')
|
|
254
|
|
- tmp = [None] * len(lines)
|
|
255
|
|
- for idx in xrange(len(lines)):
|
|
256
|
|
- (a, b) = lines[idx].split(" ")
|
|
257
|
|
- tmp[idx] = a + getpipeoutput(['git-ls-tree -r ' + b, 'wc -l']).strip('\n')
|
|
258
|
|
- lines = tmp
|
|
|
252
|
+ revlines = getpipeoutput(['git-rev-list --pretty=format:"%at %H" HEAD', 'grep -v ^commit']).strip().split('\n')
|
|
|
253
|
+ lines = []
|
|
|
254
|
+ for revline in revlines:
|
|
|
255
|
+ time, rev = revline.split(' ')
|
|
|
256
|
+ linecount = int(getpipeoutput(['git-ls-tree -r "%s"' % rev, 'wc -l']).split('\n')[0])
|
|
|
257
|
+ lines.append('%d %d' % (int(time), linecount))
|
|
259
|
258
|
|
|
260
|
259
|
self.total_commits = len(lines)
|
|
261
|
260
|
for line in lines:
|