|
|
|
@ -348,10 +348,6 @@ update
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
|
|
|
|
# @changesets = @repository.latest_changesets(@path, @rev)
|
|
|
|
|
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
|
|
|
@ -378,19 +374,6 @@ update
|
|
|
|
|
|
|
|
|
|
alias_method :browse, :show
|
|
|
|
|
|
|
|
|
|
#add by hx
|
|
|
|
|
def count_commits(project_id , left , right)
|
|
|
|
|
count = 0
|
|
|
|
|
(left..right).each do |page|
|
|
|
|
|
if $g.commits(project_id,:page => page).count == 0
|
|
|
|
|
break
|
|
|
|
|
else
|
|
|
|
|
count = count + $g.commits(project_id,:page => page).count
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def changes
|
|
|
|
|
@entry = @repository.entry(@path, @rev)
|
|
|
|
|
(show_error_not_found; return) unless @entry
|
|
|
|
@ -400,26 +383,10 @@ update
|
|
|
|
|
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
|
|
|
|
|
|
|
|
|
|
#add by hx
|
|
|
|
|
if g.commits(@project.gpid , :page=>200).count > 0
|
|
|
|
|
count = 4020
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>25).count==0
|
|
|
|
|
count = count_commits(@project.gpid , 0 , 25)
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>50).count ==0
|
|
|
|
|
count = count_commits(@project.gpid , 25 , 50)+ 25 * 20
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>75).count ==0
|
|
|
|
|
count = count_commits(@project.gpid , 50 , 75)+ 50 * 20
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>100).count== 0
|
|
|
|
|
count = count_commits(@project.gpid , 75 , 100) + 75 * 20
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>125).count==0
|
|
|
|
|
count = count_commits(@project.gpid , 100 , 125) + 100 * 20
|
|
|
|
|
elsif g.commits(@project.gpid , :page=>150).count==0
|
|
|
|
|
count = count_commits(@project.gpid , 125 , 150) + 125 * 20
|
|
|
|
|
else
|
|
|
|
|
count = count_commits(@project.gpid , 150 ,200) + 150 * 20
|
|
|
|
|
end
|
|
|
|
|
rep_count = commit_count(@project)
|
|
|
|
|
|
|
|
|
|
#页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化
|
|
|
|
|
@commits_count = count
|
|
|
|
|
@commits_count = rep_count
|
|
|
|
|
@commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
|
|
|
|
|
|
|
|
|
|
@commit = g.commit(@project.gpid,@rev)
|
|
|
|
|