@@ -36,23 +36,29 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 | system "svnadmin create #{repo_path}" |
|
39 | unless File.exists?(repo_path) | |
40 | system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" |
|
40 | system "svnadmin create #{repo_path}" | |
|
41 | system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}" | |||
|
42 | end | |||
41 | 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" | |
46 | bundle_path = "test/fixtures/repositories/mercurial_repository.hg" |
|
48 | unless File.exists?(repo_path) | |
47 | system "hg init #{repo_path}" |
|
49 | bundle_path = "test/fixtures/repositories/mercurial_repository.hg" | |
48 |
system "hg |
|
50 | system "hg init #{repo_path}" | |
|
51 | system "hg -R #{repo_path} pull #{bundle_path}" | |||
|
52 | end | |||
49 | 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 | |
54 | # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" |
|
58 | unless File.exists?("tmp/test/#{scm}_repository") | |
55 |
system " |
|
59 | # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test" | |
|
60 | system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz" | |||
|
61 | end | |||
56 | end |
|
62 | end | |
57 | end |
|
63 | end | |
58 |
|
64 |
General Comments 0
You need to be logged in to leave comments.
Login now