Index: reposman.rb =================================================================== --- reposman.rb (revision 3859) +++ reposman.rb (working copy) @@ -245,6 +245,20 @@ if File.directory?(repos_path) + # added by riceball to fix the exists local repository not sync to the empty scm configuration in redmine' db + if $force == false and project.respond_to?(:repository) + log("\trepository for project #{project.identifier} already exists in Redmine", :level => 1) + next + end + if $svn_url + begin + project.post(:repository, :vendor => $scm, :repository => {:url => "#{$svn_url}#{project.identifier}"}, :key => $api_key) + log("\trepository #{repos_path} registered in Redmine with url #{$svn_url}#{project.identifier}"); + rescue => e + log("\trepository #{repos_path} not registered in Redmine: #{e.message}"); + end + end + # we must verify that repository has the good owner and the good # rights before leaving other_read = other_read_right?(repos_path) @@ -307,4 +321,4 @@ end end - \ No newline at end of file +