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
This commit is contained in:
Jean-Philippe Lang 2010-01-17 12:00:45 +00:00
parent d55e1ec5b0
commit b4cf8ea525
2 changed files with 9 additions and 1 deletions

View File

@ -331,6 +331,7 @@ task :migrate_from_mantis => :environment do
next unless i.save next unless i.save
issues_map[bug.id] = i.id issues_map[bug.id] = i.id
print '.' print '.'
STDOUT.flush
# Assignee # Assignee
# Redmine checks that the assignee is a project member # 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]) r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id])
pp r unless r.save pp r unless r.save
print '.' print '.'
STDOUT.flush
end end
puts puts
@ -393,6 +395,7 @@ task :migrate_from_mantis => :environment do
n.author = User.find_by_id(users_map[news.poster_id]) n.author = User.find_by_id(users_map[news.poster_id])
n.save n.save
print '.' print '.'
STDOUT.flush
end end
puts puts
@ -409,7 +412,7 @@ task :migrate_from_mantis => :environment do
:is_required => field.require_report? :is_required => field.require_report?
next unless f.save next unless f.save
print '.' print '.'
STDOUT.flush
# Trackers association # Trackers association
f.trackers = Tracker.find :all 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." puts "WARNING: Your Redmine data will be deleted during this process."
print "Are you sure you want to continue ? [y/N] " print "Are you sure you want to continue ? [y/N] "
STDOUT.flush
break unless STDIN.gets.match(/^y$/i) break unless STDIN.gets.match(/^y$/i)
# Default Mantis database settings # Default Mantis database settings
@ -494,6 +498,7 @@ task :migrate_from_mantis => :environment do
while true while true
print "encoding [UTF-8]: " print "encoding [UTF-8]: "
STDOUT.flush
encoding = STDIN.gets.chomp! encoding = STDIN.gets.chomp!
encoding = 'UTF-8' if encoding.blank? encoding = 'UTF-8' if encoding.blank?
break if MantisMigrate.encoding encoding break if MantisMigrate.encoding encoding

View File

@ -676,6 +676,7 @@ namespace :redmine do
puts puts
puts "This project already exists in your Redmine database." puts "This project already exists in your Redmine database."
print "Are you sure you want to append data to this project ? [Y/n] " print "Are you sure you want to append data to this project ? [Y/n] "
STDOUT.flush
exit if STDIN.gets.match(/^n$/i) exit if STDIN.gets.match(/^n$/i)
end end
project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG) 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." puts "WARNING: a new project will be added to Redmine during this process."
print "Are you sure you want to continue ? [y/N] " print "Are you sure you want to continue ? [y/N] "
STDOUT.flush
break unless STDIN.gets.match(/^y$/i) break unless STDIN.gets.match(/^y$/i)
puts puts
@ -733,6 +735,7 @@ namespace :redmine do
default = options[:default] || '' default = options[:default] || ''
while true while true
print "#{text} [#{default}]: " print "#{text} [#{default}]: "
STDOUT.flush
value = STDIN.gets.chomp! value = STDIN.gets.chomp!
value = default if value.blank? value = default if value.blank?
break if yield value break if yield value