parent
a4209bc9f7
commit
6e7950983b
|
@ -224,10 +224,6 @@ update
|
||||||
#if( !User.current.member_of?(@project) || @project.hidden_repo)
|
#if( !User.current.member_of?(@project) || @project.hidden_repo)
|
||||||
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
@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
|
# :name, :path, :kind, :size, :lastrev, :changeset
|
||||||
@entries = @repository.entries(@path, @rev)
|
@entries = @repository.entries(@path, @rev)
|
||||||
# @trees = g.trees(project, @path)
|
# @trees = g.trees(project, @path)
|
||||||
|
@ -241,10 +237,18 @@ update
|
||||||
#Modified by young
|
#Modified by young
|
||||||
# (show_error_not_found; return) unless @entries
|
# (show_error_not_found; return) unless @entries
|
||||||
g = Gitlab.client
|
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 = g.commits(@project.gpid)
|
||||||
# @changesets = @repository.latest_changesets(@path, @rev)
|
# @changesets = @repository.latest_changesets(@path, @rev)
|
||||||
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
||||||
@changesets_count = @changesets.count
|
@changesets_all_count = count
|
||||||
@changesets_latest_coimmit = @changesets[0]
|
@changesets_latest_coimmit = @changesets[0]
|
||||||
@properties = @repository.properties(@path, @rev)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@repositories = @project.repositories
|
@repositories = @project.repositories
|
||||||
|
@ -271,7 +275,9 @@ update
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(show_error_not_found; return) unless @entry
|
||||||
g = Gitlab.client
|
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)
|
#@changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
|
||||||
@properties = @repository.properties(@path, @rev)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@changeset = @repository.find_changeset_by_name(@rev)
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<%= render_properties(@properties) %>
|
<%= render_properties(@properties) %>
|
||||||
|
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<%= 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? %>
|
||||||
</div>
|
</div>
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag "scm" %>
|
<%= stylesheet_link_tag "scm" %>
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
||||||
<%=link_to @changesets_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %></font> 提交
|
<%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev} %></font> 提交
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,23 +1,11 @@
|
||||||
#coding=utf-8
|
#coding=utf-8
|
||||||
|
|
||||||
namespace :rep_fault do
|
namespace :rep_fault do
|
||||||
desc "update fault rep"
|
desc "set ossean's type value"
|
||||||
task :rep_update => :environment do
|
task :rep_update => :environment do
|
||||||
Project.all.each do |project|
|
rep = Repository.find(400)
|
||||||
if project.repositories.count > 0
|
rep.type = "Repository::Gitlab"
|
||||||
unless Repository.where("project_id =? and type = ?",project, "Repository::Gitlab").blank?
|
rep.save
|
||||||
project.repositories.each do |repository|
|
|
||||||
repository.is_default =1
|
|
||||||
repository.save
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# desc "update ossean's data"
|
|
||||||
# task :update_type => :environment do
|
|
||||||
# repository = Repository.find(400)
|
|
||||||
# repository.update_attributes(:type => "Repository::Git")
|
|
||||||
# end
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue