Permalink
Browse files

Adding check for only one commit.

  • Loading branch information...
1 parent 9ef45c9 commit 894f0264cb4fe880bd6fee5e95dd40820e785eb4 @mrjbq7 mrjbq7 committed Jun 10, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 tracstats/web_ui.py
View
@@ -405,7 +405,10 @@ def _process_code(self, req, cursor, where, data):
commits = len(set(x[0] for x in revisions if x[2] == author))
mintime = min(x[1] for x in revisions if x[2] == author)
maxtime = max(x[1] for x in revisions if x[2] == author)
- rate = commits * 24.0 * 60 * 60 / (maxtime - mintime)
+ if maxtime > mintime:
+ rate = commits * 24.0 * 60 * 60 / (maxtime - mintime)
+ else:
+ rate = 0
change = sum(1 for x in changes if x[3] == author)
paths = len(set(x[1] for x in changes if x[3] == author))

0 comments on commit 894f026

Please sign in to comment.