Fixed retrieving of commit index from vcs

Change-Id: Ic917f8f2bf734d7cb4a68eba325c686cbf7877d5
This commit is contained in:
Ilya Shakhat 2013-08-01 20:12:54 +04:00
parent 0150e0ca28
commit 4d228d61ae
3 changed files with 11 additions and 2 deletions

View File

@ -34,7 +34,7 @@
{% block right_frame %}
<h2>Recent commits</h2>
<h2>Recent activity</h2>
{% for rec in commits %}
<div style="padding-bottom: 1em;">

View File

@ -548,11 +548,17 @@ def timeline(records, **kwargs):
week_stat_commits = dict((c, 0) for c in weeks)
week_stat_commits_hl = dict((c, 0) for c in weeks)
param = get_parameter(kwargs, 'metric')
if ('reviews' in param) or ('marks' in param):
handler = lambda record: 0
else:
handler = lambda record: record['loc']
# fill stats with the data
for record in records:
week = record['week']
if week in weeks:
week_stat_loc[week] += record['loc']
week_stat_loc[week] += handler(record)
week_stat_commits[week] += 1
if 'all' in release_names or record['release'] in release_names:
week_stat_commits_hl[week] += 1

View File

@ -100,6 +100,9 @@ class Git(Vcs):
self.get_release_index()
def get_release_index(self):
if not os.path.exists(self.folder):
return {}
os.chdir(self.folder)
if not self.release_index:
for release in self.repo['releases']: