Skip to content

Commit bf7ca4c

Browse files
committed
added developer commit history example for annual purge
svn path=/trunk/matplotlib/; revision=8875
1 parent d09329a commit bf7ca4c

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
"""
2+
report how many days it has been since each developer committed. You
3+
must do an
4+
5+
svn log > log.txt
6+
7+
and place the output next to this file before running
8+
9+
"""
10+
import os, datetime
11+
12+
import matplotlib.cbook as cbook
13+
14+
todate = cbook.todate('%Y-%m-%d')
15+
today = datetime.date.today()
16+
if not os.path.exists('log.txt'):
17+
print('You must place the "svn log" output into a file "log.txt"')
18+
raise SystemExit
19+
20+
parse = False
21+
22+
lastd = dict()
23+
for line in file('log.txt'):
24+
if line.startswith('--------'):
25+
parse = True
26+
continue
27+
28+
if parse:
29+
parts = [part.strip() for part in line.split('|')]
30+
developer = parts[1]
31+
dateparts = parts[2].split(' ')
32+
ymd = todate(dateparts[0])
33+
34+
35+
if developer not in lastd:
36+
lastd[developer] = ymd
37+
38+
parse = False
39+
40+
dsu = [((today - lastdate).days, developer) for developer, lastdate in lastd.items()]
41+
42+
dsu.sort()
43+
for timedelta, developer in dsu:
44+
print('%s : %d'%(developer, timedelta))

0 commit comments

Comments
 (0)