1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-15 21:48:13 +00:00

Adds support for --scm option to reposman.rb.

git-svn-id: http://redmine.rubyforge.org/svn/branches/nbc@1807 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-09-13 11:11:48 +00:00
parent 7bde4105b8
commit 73123fa484

View File

@ -37,6 +37,12 @@
# -u file:///var/svn/ # if the repository is local # -u file:///var/svn/ # if the repository is local
# if this option isn't set, reposman won't register the repository # if this option isn't set, reposman won't register the repository
# #
# --scm
# SCM vendor used to register the repository in Redmine (default: Subversion)
# Can be one of the other supported SCM: Bazaar, Cvs, Darcs, Filesystem, Git, Mercurial (case sensitive).
# This option should be used when using --command to create another kind
# of repository.
#
# -c, --command=COMMAND # -c, --command=COMMAND
# the default is to create an subversion repository. You can use this command # the default is to create an subversion repository. You can use this command
# to create another kind of repository # to create another kind of repository
@ -73,6 +79,7 @@ opts = GetoptLong.new(
['--redmine-host', '-r', GetoptLong::REQUIRED_ARGUMENT], ['--redmine-host', '-r', GetoptLong::REQUIRED_ARGUMENT],
['--owner', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--owner', '-o', GetoptLong::REQUIRED_ARGUMENT],
['--url', '-u', GetoptLong::REQUIRED_ARGUMENT], ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
['--scm', GetoptLong::REQUIRED_ARGUMENT],
['--command' , '-c', GetoptLong::REQUIRED_ARGUMENT], ['--command' , '-c', GetoptLong::REQUIRED_ARGUMENT],
['--test', '-t', GetoptLong::NO_ARGUMENT], ['--test', '-t', GetoptLong::NO_ARGUMENT],
['--force', '-f', GetoptLong::NO_ARGUMENT], ['--force', '-f', GetoptLong::NO_ARGUMENT],
@ -92,7 +99,7 @@ $svn_url = false
$test = false $test = false
$command = "svnadmin create" $command = "svnadmin create"
$force = false $force = false
$repository_vendor = 'Subversion' $scm = 'Subversion'
def log(text,level=0, exit=false) def log(text,level=0, exit=false)
return if $quiet or level > $verbose return if $quiet or level > $verbose
@ -107,6 +114,7 @@ begin
when '--redmine-host'; $redmine_host = arg.dup when '--redmine-host'; $redmine_host = arg.dup
when '--owner'; $svn_owner = arg.dup; $use_groupid = false; when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
when '--url'; $svn_url = arg.dup when '--url'; $svn_url = arg.dup
when '--scm'; $scm = arg.dup
when '--command'; $command = arg.dup when '--command'; $command = arg.dup
when '--verbose'; $verbose += 1 when '--verbose'; $verbose += 1
when '--test'; $test = true when '--test'; $test = true
@ -241,7 +249,7 @@ projects.each do |project|
end end
if $svn_url if $svn_url
ret = soap.RepositoryCreated project.identifier, $repository_vendor, "#{$svn_url}#{project.identifier}" ret = soap.RepositoryCreated project.identifier, $scm, "#{$svn_url}#{project.identifier}"
if ret > 0 if ret > 0
log("\trepository #{repos_path} registered in Redmine with url #{$svn_url}#{project.identifier}"); log("\trepository #{repos_path} registered in Redmine with url #{$svn_url}#{project.identifier}");
else else