summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-17 12:00:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-01-17 12:00:45 +0000
commitb4cf8ea52512b6db80262a508f1b30b3e3cfbd39 (patch)
tree7e981986cf381a6652889541362d5840cd8b45cf /lib
parentd55e1ec5b092f8e4f342c047bab64e6cdf24aa92 (diff)
downloadredmine-b4cf8ea52512b6db80262a508f1b30b3e3cfbd39.tar.gz
redmine-b4cf8ea52512b6db80262a508f1b30b3e3cfbd39.zip
Adds a few STDOUT.flush to migration scripts (#3675).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3328 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/migrate_from_mantis.rake7
-rw-r--r--lib/tasks/migrate_from_trac.rake3
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake
index 95722b12b..594a7ec0e 100644
--- a/lib/tasks/migrate_from_mantis.rake
+++ b/lib/tasks/migrate_from_mantis.rake
@@ -331,6 +331,7 @@ task :migrate_from_mantis => :environment do
next unless i.save
issues_map[bug.id] = i.id
print '.'
+ STDOUT.flush
# Assignee
# Redmine checks that the assignee is a project member
@@ -378,6 +379,7 @@ task :migrate_from_mantis => :environment do
r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id])
pp r unless r.save
print '.'
+ STDOUT.flush
end
puts
@@ -393,6 +395,7 @@ task :migrate_from_mantis => :environment do
n.author = User.find_by_id(users_map[news.poster_id])
n.save
print '.'
+ STDOUT.flush
end
puts
@@ -409,7 +412,7 @@ task :migrate_from_mantis => :environment do
:is_required => field.require_report?
next unless f.save
print '.'
-
+ STDOUT.flush
# Trackers association
f.trackers = Tracker.find :all
@@ -475,6 +478,7 @@ task :migrate_from_mantis => :environment do
puts "WARNING: Your Redmine data will be deleted during this process."
print "Are you sure you want to continue ? [y/N] "
+ STDOUT.flush
break unless STDIN.gets.match(/^y$/i)
# Default Mantis database settings
@@ -494,6 +498,7 @@ task :migrate_from_mantis => :environment do
while true
print "encoding [UTF-8]: "
+ STDOUT.flush
encoding = STDIN.gets.chomp!
encoding = 'UTF-8' if encoding.blank?
break if MantisMigrate.encoding encoding
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 8c6838ae2..dd129e4a5 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -676,6 +676,7 @@ namespace :redmine do
puts
puts "This project already exists in your Redmine database."
print "Are you sure you want to append data to this project ? [Y/n] "
+ STDOUT.flush
exit if STDIN.gets.match(/^n$/i)
end
project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG)
@@ -726,6 +727,7 @@ namespace :redmine do
puts "WARNING: a new project will be added to Redmine during this process."
print "Are you sure you want to continue ? [y/N] "
+ STDOUT.flush
break unless STDIN.gets.match(/^y$/i)
puts
@@ -733,6 +735,7 @@ namespace :redmine do
default = options[:default] || ''
while true
print "#{text} [#{default}]: "
+ STDOUT.flush
value = STDIN.gets.chomp!
value = default if value.blank?
break if yield value