review-update-needed: also show, when verbose, how many packages are claimed per person

parent 116b196d
#!/usr/bin/python3
import argparse
import collections
from datetime import datetime
import os
import re
......@@ -52,6 +53,7 @@ process = subprocess.Popen(["git", "blame", "--line-porcelain", "--",
context = {}
in_preamble = True
all_entries = []
per_user = collections.defaultdict(list)
entry = None
for line in process.stdout:
line = line.decode('utf-8')
......@@ -91,6 +93,7 @@ for line in process.stdout:
'author': context['author'],
'note': '',
}
per_user[entry['claimed-by']].append(entry['pkg'])
all_entries.append(entry)
retcode = process.wait()
......@@ -120,3 +123,9 @@ for entry in all_entries:
print("Notes:\n{}".format(entry['note']))
else:
print("")
if args.verbose:
# sort by number of claimed packages
items = sorted(per_user.items(), key=lambda x: len(x[1]))
for user, pkgs in items:
print("User: {}\nPackages: {}\nCount: {}\n".format(user, ", ".join(pkgs), len(pkgs)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment