@@ -36,25 +36,31 namespace :test do | |||||
36 | desc "Creates a test subversion repository" |
|
36 | desc "Creates a test subversion repository" | |
37 | task :subversion => :create_dir do |
|
37 | task :subversion => :create_dir do | |
38 | repo_path = "tmp/test/subversion_repository" |
|
38 | repo_path = "tmp/test/subversion_repository" | |
|
39 | unless File.exists?(repo_path) | |||
39 | system "svnadmin create #{repo_path}" |
|
40 | system "svnadmin create #{repo_path}" | |
40 | system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" |
|
41 | system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" | |
41 | end |
|
42 | end | |
|
43 | end | |||
42 |
|
44 | |||
43 | desc "Creates a test mercurial repository" |
|
45 | desc "Creates a test mercurial repository" | |
44 | task :mercurial => :create_dir do |
|
46 | task :mercurial => :create_dir do | |
45 | repo_path = "tmp/test/mercurial_repository" |
|
47 | repo_path = "tmp/test/mercurial_repository" | |
|
48 | unless File.exists?(repo_path) | |||
46 | bundle_path = "test/fixtures/repositories/mercurial_repository.hg" |
|
49 | bundle_path = "test/fixtures/repositories/mercurial_repository.hg" | |
47 | system "hg init #{repo_path}" |
|
50 | system "hg init #{repo_path}" | |
48 | system "hg -R #{repo_path} pull #{bundle_path}" |
|
51 | system "hg -R #{repo_path} pull #{bundle_path}" | |
49 | end |
|
52 | end | |
|
53 | end | |||
50 |
|
54 | |||
51 | (supported_scms - [:subversion, :mercurial]).each do |scm| |
|
55 | (supported_scms - [:subversion, :mercurial]).each do |scm| | |
52 | desc "Creates a test #{scm} repository" |
|
56 | desc "Creates a test #{scm} repository" | |
53 | task scm => :create_dir do |
|
57 | task scm => :create_dir do | |
|
58 | unless File.exists?("tmp/test/#{scm}_repository") | |||
54 | # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" |
|
59 | # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" | |
55 | system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz" |
|
60 | system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz" | |
56 | end |
|
61 | end | |
57 | end |
|
62 | end | |
|
63 | end | |||
58 |
|
64 | |||
59 | desc "Creates all test repositories" |
|
65 | desc "Creates all test repositories" | |
60 | task :all => supported_scms |
|
66 | task :all => supported_scms |
General Comments 0
You need to be logged in to leave comments.
Login now