diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e25d01650..1f252cc24 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -224,10 +224,6 @@ update #if( !User.current.member_of?(@project) || @project.hidden_repo) @repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty? - # g = Gitlab.client - # project = g.project(20) - # rr = g.trees(project.id, @path) - # r = g.get ("/projects/#{@project}/repository/tree") # :name, :path, :kind, :size, :lastrev, :changeset @entries = @repository.entries(@path, @rev) # @trees = g.trees(project, @path) @@ -241,10 +237,18 @@ update #Modified by young # (show_error_not_found; return) unless @entries g = Gitlab.client + count = 0 + (0..100).each do |page| + if g.commits(@project.gpid,:page => page).count == 0 + break + else + count = count + g.commits(@project.gpid,:page => page).count + end + end @changesets = g.commits(@project.gpid) # @changesets = @repository.latest_changesets(@path, @rev) # @changesets_count = @repository.latest_changesets(@path, @rev).count - @changesets_count = @changesets.count + @changesets_all_count = count @changesets_latest_coimmit = @changesets[0] @properties = @repository.properties(@path, @rev) @repositories = @project.repositories @@ -271,7 +275,9 @@ update @entry = @repository.entry(@path, @rev) (show_error_not_found; return) unless @entry g = Gitlab.client - @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}") + @commits = g.commits(@project.gpid, page:params[:pamge]) + @commit = g.commit(@project.gpid,@rev) + # @changesets = g.get ("/projects/#{@project.gpid}/repository/commits?#{@rev}") #@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) diff --git a/app/views/repositories/changes.html.erb b/app/views/repositories/changes.html.erb index f4037cb36..428799f07 100644 --- a/app/views/repositories/changes.html.erb +++ b/app/views/repositories/changes.html.erb @@ -14,7 +14,7 @@ <%= render_properties(@properties) %>
- <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %> + <%= render(:partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @commits, :entry => @entry }) unless @commits.empty? %>
<% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 83f1a07ed..9601e5188 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -40,7 +40,7 @@ - <%=link_to @changesets_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %> 提交 + <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %> 提交 <% end %> diff --git a/lib/tasks/update_rep_if_fault.rake b/lib/tasks/update_rep_if_fault.rake index 1c1f5a36e..3c7d119f2 100644 --- a/lib/tasks/update_rep_if_fault.rake +++ b/lib/tasks/update_rep_if_fault.rake @@ -1,23 +1,11 @@ #coding=utf-8 namespace :rep_fault do - desc "update fault rep" + desc "set ossean's type value" task :rep_update => :environment do - Project.all.each do |project| - if project.repositories.count > 0 - unless Repository.where("project_id =? and type = ?",project, "Repository::Gitlab").blank? - project.repositories.each do |repository| - repository.is_default =1 - repository.save - end - end - end - end + rep = Repository.find(400) + rep.type = "Repository::Gitlab" + rep.save end - # desc "update ossean's data" - # task :update_type => :environment do - # repository = Repository.find(400) - # repository.update_attributes(:type => "Repository::Git") - # end end \ No newline at end of file