:expects => [],
:returns => [[AWSProjectWithRepository]]
api_method :repository_created,
- :expects => [:string, :string],
+ :expects => [:string, :string, :string],
:returns => [:int]
end
end
# Registers a repository for the given project identifier
- # (Subversion specific)
- def repository_created(identifier, url)
+ def repository_created(identifier, vendor, url)
project = Project.find_by_identifier(identifier)
# Do not create the repository if the project has already one
return 0 unless project && project.repository.nil?
logger.debug "Repository for #{project.name} was created"
- repository = Repository.factory('Subversion', :project => project, :url => url)
+ repository = Repository.factory(vendor, :project => project, :url => url)
repository.save
repository.id || 0
end
$test = false
$command = "svnadmin create"
$force = false
+$repository_vendor = 'Subversion'
def log(text,level=0, exit=false)
return if $quiet or level > $verbose
end
if $svn_url
- ret = soap.RepositoryCreated project.identifier, "#{$svn_url}#{project.identifier}"
+ ret = soap.RepositoryCreated project.identifier, $repository_vendor, "#{$svn_url}#{project.identifier}"
if ret > 0
log("\trepository #{repos_path} registered in Redmine with url #{$svn_url}#{project.identifier}");
else
def test_repository_created
project = Project.find(3)
assert_nil project.repository
- assert invoke(:repository_created, project.identifier, 'http://localhost/svn')
+ assert invoke(:repository_created, project.identifier, 'Subversion', 'http://localhost/svn')
project.reload
assert_not_nil project.repository
+ assert project.repository.is_a?(Repository::Subversion)
+ assert_equal 'http://localhost/svn', project.repository.url
end
end