Project

General

Profile

Patch #1058 ยป svn.x3n.patch

Lionel Molinier, 2008-04-15 08:40

View differences:

redmine-0.6.3-patched/app/apis/sys_api.rb 2008-04-14 11:45:11.000000000 +0200
22 22
  api_method :repository_created,
23 23
             :expects => [:string, :string],
24 24
             :returns => [:int]
25
  api_method :requires_repository,
26
             :expects => [:string],
27
             :returns => [:int]
25 28
end
redmine-0.6.3-patched/app/controllers/sys_controller.rb 2008-04-14 11:47:36.000000000 +0200
27 27
    Project.find(:all, :include => :repository)
28 28
  end
29 29

  
30
	def requires_repository(identifier)
31
    project = Project.find_by_identifier(identifier)
32
    # Do not create the repository if the project has already one
33
    return 0 unless project && project.repository.nil?
34
		return 0 unless project.module_enabled?("repository")
35
		return 1
36
	end
37

  
30 38
  # Registers a repository for the given project identifier
31 39
  # (Subversion specific)
32 40
  def repository_created(identifier, url)
redmine-0.6.3-patched/extra/svn/reposman.rb 2008-04-14 11:44:53.000000000 +0200
82 82
$svn_url      = false
83 83
$test         = false
84 84

  
85
$autodir = ["trunk", "tags", "branches"]
86

  
85 87
def log(text,level=0, exit=false)
86 88
  return if $quiet or level > $verbose
87 89
  puts text
......
167 169

  
168 170
projects.each do |project|
169 171
  log("treating project #{project.name}", 1)
172
	next if soap.RequiresRepository(project.identifier)==0
170 173

  
171 174
  if project.identifier.empty?
172 175
    log("\tno identifier for project #{project.name}")
......
212 215
    begin
213 216
      set_owner_and_rights(project, repos_path) do
214 217
        raise "svnadmin create #{repos_path} failed" unless system("svnadmin", "create", repos_path)
218
				$autodir.each do |dir|
219
					raise "svn mkdir #{$svn_url}#{project.identifier}/#{dir} failed" unless system("svn", "mkdir", $svn_url+project.identifier+"/"+dir, "-m \"Autocreate #{dir}\"")
220
					log("\tautocreating directory for repository #{repos_path}: #{dir}");
221
				end
215 222
      end
216 223
    rescue => e
217 224
      log("\tunable to create #{repos_path} : #{e}\n")
    (1-1/1)