|
|
@@ -27,34 +27,37 @@ def gen_revision_data(conf, row_processor):
|
|
27
|
27
|
['git rev-list --pretty=format:"%%T %%H %%at %%ai %%aN <%%aE>" %s' % getlogrange(conf, 'HEAD'),
|
|
28
|
28
|
'grep -v ^commit']).split('\n')
|
|
29
|
29
|
for line in lines:
|
|
30
|
|
- parts = line.split(' ', 6)
|
|
31
|
|
- tree_hash = parts[0]
|
|
32
|
|
- sha = parts[1]
|
|
33
|
|
- try:
|
|
34
|
|
- stamp = int(parts[2])
|
|
35
|
|
- except ValueError:
|
|
36
|
|
- stamp = 0
|
|
37
|
|
- timezone = parts[5]
|
|
38
|
|
- author, mail = parts[6].split('<', 1)
|
|
39
|
|
- author = author.strip()
|
|
40
|
|
- mail = mail.rstrip('>')
|
|
41
|
|
- domain = '?'
|
|
42
|
|
- if mail.find('@') != -1:
|
|
43
|
|
- domain = mail.rsplit('@', 1)[1]
|
|
44
|
|
- domain.rstrip('>')
|
|
45
|
|
- revisions[tree_hash] = Revision(sha, stamp, timezone, author, mail, domain)
|
|
|
30
|
+ line = line.strip()
|
|
|
31
|
+ if line:
|
|
|
32
|
+ parts = line.split(' ', 6)
|
|
|
33
|
+ tree_hash = parts[0]
|
|
|
34
|
+ sha = parts[1]
|
|
|
35
|
+ try:
|
|
|
36
|
+ stamp = int(parts[2])
|
|
|
37
|
+ except ValueError:
|
|
|
38
|
+ stamp = 0
|
|
|
39
|
+ timezone = parts[5]
|
|
|
40
|
+ author, mail = parts[6].split('<', 1)
|
|
|
41
|
+ author = author.strip()
|
|
|
42
|
+ mail = mail.rstrip('>')
|
|
|
43
|
+ domain = '?'
|
|
|
44
|
+ if mail.find('@') != -1:
|
|
|
45
|
+ domain = mail.rsplit('@', 1)[1]
|
|
|
46
|
+ domain.rstrip('>')
|
|
|
47
|
+ revisions[tree_hash] = Revision(sha, stamp, timezone, author, mail, domain)
|
|
46
|
48
|
|
|
47
|
|
- # todo: consider putting in a cache for this. There was one in the original code
|
|
48
|
|
- # DBG: git ls-tree -r --name-only "ceb3165b51ae0680724fd71e16a5ff836a0de41e"', 'wc -l'
|
|
49
|
|
- pool = Pool(processes=conf['processes'])
|
|
50
|
|
- rev_count = pool.map(getnumoffilesfromrev, revisions.keys())
|
|
51
|
|
- pool.terminate()
|
|
52
|
|
- pool.join()
|
|
53
|
|
- # Update cache with new revisions and append then to general list
|
|
54
|
|
- for (rev, count) in rev_count:
|
|
55
|
|
- revision = revisions[rev]
|
|
56
|
|
- revision.file_count = count
|
|
57
|
|
- row_processor(revision)
|
|
|
49
|
+ if revisions:
|
|
|
50
|
+ # todo: consider putting in a cache for this. There was one in the original code
|
|
|
51
|
+ # DBG: git ls-tree -r --name-only "ceb3165b51ae0680724fd71e16a5ff836a0de41e"', 'wc -l'
|
|
|
52
|
+ pool = Pool(processes=conf['processes'])
|
|
|
53
|
+ rev_count = pool.map(getnumoffilesfromrev, revisions.keys())
|
|
|
54
|
+ pool.terminate()
|
|
|
55
|
+ pool.join()
|
|
|
56
|
+ # Update cache with new revisions and append then to general list
|
|
|
57
|
+ for (rev, count) in rev_count:
|
|
|
58
|
+ revision = revisions[rev]
|
|
|
59
|
+ revision.file_count = count
|
|
|
60
|
+ row_processor(revision)
|
|
58
|
61
|
|
|
59
|
62
|
return len(lines)
|
|
60
|
63
|
|