diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-09 17:23:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-03-09 17:23:22 +0000 |
commit | 494a6ecfb0a90bb3ddf46f3ee5a886a3496bea30 (patch) | |
tree | 2a88cf6a6259f5a5ad93c127f24445d0b65220df /lib | |
parent | 66594d46b20d5d30ca7820cc69c1652ee9884ad9 (diff) | |
download | redmine-494a6ecfb0a90bb3ddf46f3ee5a886a3496bea30.tar.gz redmine-494a6ecfb0a90bb3ddf46f3ee5a886a3496bea30.zip |
Trac and Mantis importers: check that default configuration is loaded before processing.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1221 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/migrate_from_mantis.rake | 8 | ||||
-rw-r--r-- | lib/tasks/migrate_from_trac.rake | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 5f9663a39..bf3c32ccd 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -460,6 +460,14 @@ task :migrate_from_mantis => :environment do end
puts
+ if Redmine::DefaultData::Loader.no_data?
+ puts "Redmine configuration need to be loaded before importing data."
+ puts "Please, run this first:"
+ puts
+ puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\""
+ exit
+ end
+
puts "WARNING: Your Redmine data will be deleted during this process."
print "Are you sure you want to continue ? [y/N] "
break unless STDIN.gets.match(/^y$/i)
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index d61640bfb..9ece2cf39 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -571,6 +571,14 @@ namespace :redmine do end puts + if Redmine::DefaultData::Loader.no_data? + puts "Redmine configuration need to be loaded before importing data." + puts "Please, run this first:" + puts + puts " rake redmine:load_default_data RAILS_ENV=\"#{ENV['RAILS_ENV']}\"" + exit + end + puts "WARNING: a new project will be added to Redmine during this process." print "Are you sure you want to continue ? [y/N] " break unless STDIN.gets.match(/^y$/i) |