|
|
|
@ -127,18 +127,19 @@ update
|
|
|
|
|
end
|
|
|
|
|
else # 原逻辑
|
|
|
|
|
##xianbo
|
|
|
|
|
params[:repository_scm] = "Git"
|
|
|
|
|
@root_path=RepositoriesHelper::ROOT_PATH
|
|
|
|
|
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
|
|
|
|
|
@project_path=@root_path+"htdocs/"+@repository_name
|
|
|
|
|
@repository_tag=params[:repository][:upassword] || params[:repository][:password] || '1234'
|
|
|
|
|
@repository_tag=params[:repository][:upassword] || params[:repository][:password]
|
|
|
|
|
@repo_name=User.current.login.to_s+"_"+params[:repository][:identifier]
|
|
|
|
|
logger.info "htpasswd -mb "+@root_path+"htdocs/user.passwd "+@repo_name+": "+@repository_tag
|
|
|
|
|
logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name
|
|
|
|
|
attrs = pickup_extra_info
|
|
|
|
|
params[:repository][:url]=@project_path
|
|
|
|
|
if((@repository_tag!="")&¶ms[:repository_scm]=="Git")
|
|
|
|
|
params[:repository][:url]=@project_path
|
|
|
|
|
end
|
|
|
|
|
###xianbo
|
|
|
|
|
@repository = Repository.factory(params[:repository_scm]||"Git")
|
|
|
|
|
@repository = Repository.factory(params[:repository_scm])
|
|
|
|
|
@repository.safe_attributes = params[:repository]
|
|
|
|
|
if attrs[:attrs_extra].keys.any?
|
|
|
|
|
@repository.merge_extra_info(attrs[:attrs_extra])
|
|
|
|
@ -277,8 +278,7 @@ update
|
|
|
|
|
@course_tag = params[:course]
|
|
|
|
|
project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT
|
|
|
|
|
ip = RepositoriesHelper::REPO_IP_ADDRESS
|
|
|
|
|
# @repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
|
|
|
|
|
@repos_url = "http://#{Setting.host_name}/#{@repository.login.to_s}/#{@repository.identifier.to_s}.git"
|
|
|
|
|
@repos_url = "http://"+@repository.login.to_s+"_"+@repository.identifier.to_s+"@"+ip.to_s+
|
|
|
|
|
@repository.url.slice(project_path_cut, @repository.url.length).to_s
|
|
|
|
|
if @course_tag == 1
|
|
|
|
|
render :action => 'show', :layout => 'base_courses'
|
|
|
|
|