# HG changeset patch # User Chris Cannam # Date 1282736816 -3600 # Node ID 80433603a2cdf4247c331444ac83c98c7a911b1e # Parent 8100616a9904e0217bd2ca41f49b6bdf8809545e * Add support for HTTP Basic Authentication to reposman web service access diff -r 8100616a9904 -r 80433603a2cd extra/svn/reposman.rb --- a/extra/svn/reposman.rb Wed Aug 25 12:11:25 2010 +0100 +++ b/extra/svn/reposman.rb Wed Aug 25 12:46:56 2010 +0100 @@ -48,6 +48,8 @@ # kind. # This command override the default creation for git # and subversion. +# --http-user=USER User for HTTP Basic authentication with Redmine WS +# --http-pass=PASSWORD Password for Basic authentication with Redmine WS # -f, --force force repository creation even if the project # repository is already declared in Redmine # -t, --test only show what should be done @@ -78,6 +80,8 @@ ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT], ['--command' , '-c', GetoptLong::REQUIRED_ARGUMENT], ['--scm', GetoptLong::REQUIRED_ARGUMENT], + ['--http-user', GetoptLong::REQUIRED_ARGUMENT], + ['--http-pass', GetoptLong::REQUIRED_ARGUMENT], ['--test', '-t', GetoptLong::NO_ARGUMENT], ['--force', '-f', GetoptLong::NO_ARGUMENT], ['--verbose', '-v', GetoptLong::NO_ARGUMENT], @@ -90,6 +94,8 @@ $quiet = false $redmine_host = '' $repos_base = '' +$http_user = '' +$http_pass = '' $svn_owner = 'root' $svn_group = 'root' $use_groupid = true @@ -138,6 +144,8 @@ when '--group'; $svn_group = arg.dup; $use_groupid = false; when '--url'; $svn_url = arg.dup when '--scm'; $scm = arg.dup.capitalize; log("Invalid SCM: #{$scm}", :exit => true) unless SUPPORTED_SCM.include?($scm) + when '--http-user'; $http_user = arg.dup + when '--http-pass'; $http_pass = arg.dup when '--command'; $command = arg.dup when '--verbose'; $verbose += 1 when '--test'; $test = true @@ -188,6 +196,8 @@ $redmine_host.gsub!(/\/$/, '') Project.site = "#{$redmine_host}/sys"; +Project.user = $http_user; +Project.password = $http_pass; begin # Get all active projects that have the Repository module enabled @@ -307,4 +317,4 @@ end end - \ No newline at end of file +