diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-26 17:14:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-03-26 17:14:06 +0000 |
commit | 8a84884d5042d0bedada0a744129f96f9a772cff (patch) | |
tree | 8d00160b13c31fb106526f01e79b5c77e138f34c | |
parent | b103052ff093cf11298715a10a8e1d43898c37b5 (diff) | |
download | redmine-8a84884d5042d0bedada0a744129f96f9a772cff.tar.gz redmine-8a84884d5042d0bedada0a744129f96f9a772cff.zip |
added changes counts on the "commits per author" svn stat graph
git-svn-id: http://redmine.rubyforge.org/svn/trunk@385 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/repositories_controller.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 7a8e0de2e..9bc9a9062 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -157,12 +157,17 @@ private def graph_commits_per_author(repository) commits_by_author = repository.changesets.count(:all, :group => :committer) commits_by_author.sort! {|x, y| x.last <=> y.last} + + changes_by_author = repository.changes.count(:all, :group => :committer) + h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o} fields = commits_by_author.collect {|r| r.first} - data = commits_by_author.collect {|r| r.last} + commits_data = commits_by_author.collect {|r| r.last} + changes_data = commits_by_author.collect {|r| h[r.first] || 0} fields = fields + [""]*(10 - fields.length) if fields.length<10 - data = data + [0]*(10 - data.length) if data.length<10 + commits_data = commits_data + [0]*(10 - commits_data.length) if commits_data.length<10 + changes_data = changes_data + [0]*(10 - changes_data.length) if changes_data.length<10 graph = SVG::Graph::BarHorizontal.new( :height => 300, @@ -177,10 +182,15 @@ private ) graph.add_data( - :data => data, + :data => commits_data, :title => l(:label_revision_plural) ) - + + graph.add_data( + :data => changes_data, + :title => l(:label_change_plural) + ) + graph.burn end |