@@ -331,6 +331,7 task :migrate_from_mantis => :environment do | |||||
331 | next unless i.save |
|
331 | next unless i.save | |
332 | issues_map[bug.id] = i.id |
|
332 | issues_map[bug.id] = i.id | |
333 | print '.' |
|
333 | print '.' | |
|
334 | STDOUT.flush | |||
334 |
|
335 | |||
335 | # Assignee |
|
336 | # Assignee | |
336 | # Redmine checks that the assignee is a project member |
|
337 | # Redmine checks that the assignee is a project member | |
@@ -378,6 +379,7 task :migrate_from_mantis => :environment do | |||||
378 | r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id]) |
|
379 | r.issue_to = Issue.find_by_id(issues_map[relation.destination_bug_id]) | |
379 | pp r unless r.save |
|
380 | pp r unless r.save | |
380 | print '.' |
|
381 | print '.' | |
|
382 | STDOUT.flush | |||
381 | end |
|
383 | end | |
382 | puts |
|
384 | puts | |
383 |
|
385 | |||
@@ -393,6 +395,7 task :migrate_from_mantis => :environment do | |||||
393 | n.author = User.find_by_id(users_map[news.poster_id]) |
|
395 | n.author = User.find_by_id(users_map[news.poster_id]) | |
394 | n.save |
|
396 | n.save | |
395 | print '.' |
|
397 | print '.' | |
|
398 | STDOUT.flush | |||
396 | end |
|
399 | end | |
397 | puts |
|
400 | puts | |
398 |
|
401 | |||
@@ -409,7 +412,7 task :migrate_from_mantis => :environment do | |||||
409 | :is_required => field.require_report? |
|
412 | :is_required => field.require_report? | |
410 | next unless f.save |
|
413 | next unless f.save | |
411 | print '.' |
|
414 | print '.' | |
412 |
|
415 | STDOUT.flush | ||
413 | # Trackers association |
|
416 | # Trackers association | |
414 | f.trackers = Tracker.find :all |
|
417 | f.trackers = Tracker.find :all | |
415 |
|
418 | |||
@@ -475,6 +478,7 task :migrate_from_mantis => :environment do | |||||
475 |
|
478 | |||
476 | puts "WARNING: Your Redmine data will be deleted during this process." |
|
479 | puts "WARNING: Your Redmine data will be deleted during this process." | |
477 | print "Are you sure you want to continue ? [y/N] " |
|
480 | print "Are you sure you want to continue ? [y/N] " | |
|
481 | STDOUT.flush | |||
478 | break unless STDIN.gets.match(/^y$/i) |
|
482 | break unless STDIN.gets.match(/^y$/i) | |
479 |
|
483 | |||
480 | # Default Mantis database settings |
|
484 | # Default Mantis database settings | |
@@ -494,6 +498,7 task :migrate_from_mantis => :environment do | |||||
494 |
|
498 | |||
495 | while true |
|
499 | while true | |
496 | print "encoding [UTF-8]: " |
|
500 | print "encoding [UTF-8]: " | |
|
501 | STDOUT.flush | |||
497 | encoding = STDIN.gets.chomp! |
|
502 | encoding = STDIN.gets.chomp! | |
498 | encoding = 'UTF-8' if encoding.blank? |
|
503 | encoding = 'UTF-8' if encoding.blank? | |
499 | break if MantisMigrate.encoding encoding |
|
504 | break if MantisMigrate.encoding encoding |
@@ -676,6 +676,7 namespace :redmine do | |||||
676 | puts |
|
676 | puts | |
677 | puts "This project already exists in your Redmine database." |
|
677 | puts "This project already exists in your Redmine database." | |
678 | print "Are you sure you want to append data to this project ? [Y/n] " |
|
678 | print "Are you sure you want to append data to this project ? [Y/n] " | |
|
679 | STDOUT.flush | |||
679 | exit if STDIN.gets.match(/^n$/i) |
|
680 | exit if STDIN.gets.match(/^n$/i) | |
680 | end |
|
681 | end | |
681 | project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG) |
|
682 | project.trackers << TRACKER_BUG unless project.trackers.include?(TRACKER_BUG) | |
@@ -726,6 +727,7 namespace :redmine do | |||||
726 |
|
727 | |||
727 | puts "WARNING: a new project will be added to Redmine during this process." |
|
728 | puts "WARNING: a new project will be added to Redmine during this process." | |
728 | print "Are you sure you want to continue ? [y/N] " |
|
729 | print "Are you sure you want to continue ? [y/N] " | |
|
730 | STDOUT.flush | |||
729 | break unless STDIN.gets.match(/^y$/i) |
|
731 | break unless STDIN.gets.match(/^y$/i) | |
730 | puts |
|
732 | puts | |
731 |
|
733 | |||
@@ -733,6 +735,7 namespace :redmine do | |||||
733 | default = options[:default] || '' |
|
735 | default = options[:default] || '' | |
734 | while true |
|
736 | while true | |
735 | print "#{text} [#{default}]: " |
|
737 | print "#{text} [#{default}]: " | |
|
738 | STDOUT.flush | |||
736 | value = STDIN.gets.chomp! |
|
739 | value = STDIN.gets.chomp! | |
737 | value = default if value.blank? |
|
740 | value = default if value.blank? | |
738 | break if yield value |
|
741 | break if yield value |
General Comments 0
You need to be logged in to leave comments.
Login now