Remove ValueError handling when getting stats from gitpython - I've fixed that bug in gitpython.
Remove ValueError handling when getting stats from gitpython - I've fixed that bug in gitpython.
diff --git a/pygit/pygit.py b/pygit/pygit.py
index 435449b..cef4d22 100644
--- a/pygit/pygit.py
+++ b/pygit/pygit.py
@@ -139,11 +139,7 @@ def group_by_date(lst):
st = dict(lines=0,files=0,insertions=0,deletions=0)
count = 0
for dt,cm in d:
- try:
- c_stats = cm.stats.total # Sometimes GitPython raises ValueError here
- except ValueError:
- pass
- else:
+ c_stats = cm.stats.total
if dt == prev:
count += 1
st['lines'] += c_stats['lines']
@@ -162,6 +158,7 @@ def group_by_date(lst):
def commits_stats(rid,branch='master'):
r = open_repo(rid)
d = r.commits(branch,max_count=200)
+ d = [c for c in d if c.parents]
grp = group_by_date(d)
dates = [g[0] for g in grp]
n_commits = [g[1] for g in grp]
diff --git a/pygit/views.py b/pygit/views.py
index 543e8b0..4cad285 100644
--- a/pygit/views.py
+++ b/pygit/views.py
@@ -28,7 +28,6 @@ def all_repos(request):
{'repos': pygit.repos()},
request)
-
def cached_stats(rid,branch,cid):
r = cache.get('git_stats_%s' % cid)
if r:
@@ -48,6 +47,7 @@ def one_repo(request,rid,branch='master'):
cid = cs[0][0]
dirs,files = pygit.root_tree(rid,branch)
dates,n_commits,files_s,lines,inss,dels = cached_stats(rid,branch,cid)
+ print dates
cht = Chart(900,200,n=2)
cht.set_scale(1,len(inss)-1,max(max(inss),max(dels)))