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) %>