Show More
@@ -0,0 +1,34 b'' | |||||
|
1 | #!/usr/bin/env python2 | |||
|
2 | # -*- coding: utf-8 -*- | |||
|
3 | ||||
|
4 | """ | |||
|
5 | Kallithea script for generating a quick overview of contributors and their | |||
|
6 | commit counts in a given revision set. | |||
|
7 | """ | |||
|
8 | import argparse | |||
|
9 | import os | |||
|
10 | from collections import Counter | |||
|
11 | import contributor_data | |||
|
12 | ||||
|
13 | def main(): | |||
|
14 | ||||
|
15 | parser = argparse.ArgumentParser(description='Generate a list of committers and commit counts.') | |||
|
16 | parser.add_argument('revset', | |||
|
17 | help='revision set specifying the commits to count') | |||
|
18 | args = parser.parse_args() | |||
|
19 | ||||
|
20 | repo_entries = [ | |||
|
21 | (contributor_data.name_fixes.get(name) or contributor_data.name_fixes.get(name.rsplit('<', 1)[0].strip()) or name).rsplit('<', 1)[0].strip() | |||
|
22 | for name in (line.strip() | |||
|
23 | for line in os.popen("""hg log -r '%s' -T '{author}\n'""" % args.revset).readlines()) | |||
|
24 | ] | |||
|
25 | ||||
|
26 | counter = Counter(repo_entries) | |||
|
27 | for name, count in counter.most_common(): | |||
|
28 | if name == '': | |||
|
29 | continue | |||
|
30 | print('%4s %s' % (count, name)) | |||
|
31 | ||||
|
32 | ||||
|
33 | if __name__ == '__main__': | |||
|
34 | main() |
General Comments 0
You need to be logged in to leave comments.
Login now