diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-01 21:01:37 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-01 21:01:37 +0000 |
commit | 55bbfa19b6ed97ec16ea5859a2e35a48ccd960a1 (patch) | |
tree | aa2c14eb88f39b50c4e1af027d63939fa64fa485 /lib | |
parent | f1358200d6967a37ed7f6e94bd630973b88cc0bb (diff) | |
download | redmine-55bbfa19b6ed97ec16ea5859a2e35a48ccd960a1.tar.gz redmine-55bbfa19b6ed97ec16ea5859a2e35a48ccd960a1.zip |
Prevent test:scm:setup:* task to overwrite if the test repository already exists.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9049 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/testing.rake | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake index 933962e10..513d2be8b 100644 --- a/lib/tasks/testing.rake +++ b/lib/tasks/testing.rake @@ -36,23 +36,29 @@ namespace :test do desc "Creates a test subversion repository" task :subversion => :create_dir do repo_path = "tmp/test/subversion_repository" - system "svnadmin create #{repo_path}" - system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" + unless File.exists?(repo_path) + system "svnadmin create #{repo_path}" + system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" + end end desc "Creates a test mercurial repository" task :mercurial => :create_dir do repo_path = "tmp/test/mercurial_repository" - bundle_path = "test/fixtures/repositories/mercurial_repository.hg" - system "hg init #{repo_path}" - system "hg -R #{repo_path} pull #{bundle_path}" + unless File.exists?(repo_path) + bundle_path = "test/fixtures/repositories/mercurial_repository.hg" + system "hg init #{repo_path}" + system "hg -R #{repo_path} pull #{bundle_path}" + end end (supported_scms - [:subversion, :mercurial]).each do |scm| desc "Creates a test #{scm} repository" task scm => :create_dir do - # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" - system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz" + unless File.exists?("tmp/test/#{scm}_repository") + # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" + system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz" + end end end |