Patch #1058 ยป svn.x3n.patch
| redmine-0.6.3-patched/app/apis/sys_api.rb 2008-04-14 11:45:11.000000000 +0200 | ||
|---|---|---|
|
api_method :repository_created,
|
||
|
:expects => [:string, :string],
|
||
|
:returns => [:int]
|
||
|
api_method :requires_repository,
|
||
|
:expects => [:string],
|
||
|
:returns => [:int]
|
||
|
end
|
||
| redmine-0.6.3-patched/app/controllers/sys_controller.rb 2008-04-14 11:47:36.000000000 +0200 | ||
|---|---|---|
|
Project.find(:all, :include => :repository)
|
||
|
end
|
||
|
|
||
|
def requires_repository(identifier)
|
||
|
project = Project.find_by_identifier(identifier)
|
||
|
# Do not create the repository if the project has already one
|
||
|
return 0 unless project && project.repository.nil?
|
||
|
return 0 unless project.module_enabled?("repository")
|
||
|
return 1
|
||
|
end
|
||
|
|
||
|
# Registers a repository for the given project identifier
|
||
|
# (Subversion specific)
|
||
|
def repository_created(identifier, url)
|
||
| redmine-0.6.3-patched/extra/svn/reposman.rb 2008-04-14 11:44:53.000000000 +0200 | ||
|---|---|---|
|
$svn_url = false
|
||
|
$test = false
|
||
|
|
||
|
$autodir = ["trunk", "tags", "branches"]
|
||
|
|
||
|
def log(text,level=0, exit=false)
|
||
|
return if $quiet or level > $verbose
|
||
|
puts text
|
||
| ... | ... | |
|
|
||
|
projects.each do |project|
|
||
|
log("treating project #{project.name}", 1)
|
||
|
next if soap.RequiresRepository(project.identifier)==0
|
||
|
|
||
|
if project.identifier.empty?
|
||
|
log("\tno identifier for project #{project.name}")
|
||
| ... | ... | |
|
begin
|
||
|
set_owner_and_rights(project, repos_path) do
|
||
|
raise "svnadmin create #{repos_path} failed" unless system("svnadmin", "create", repos_path)
|
||
|
$autodir.each do |dir|
|
||
|
raise "svn mkdir #{$svn_url}#{project.identifier}/#{dir} failed" unless system("svn", "mkdir", $svn_url+project.identifier+"/"+dir, "-m \"Autocreate #{dir}\"")
|
||
|
log("\tautocreating directory for repository #{repos_path}: #{dir}");
|
||
|
end
|
||
|
end
|
||
|
rescue => e
|
||
|
log("\tunable to create #{repos_path} : #{e}\n")
|
||