@@ -503,10 +503,17 task :migrate_from_mantis => :environment do | |||||
503 | # Make sure bugs can refer bugs in other projects |
|
503 | # Make sure bugs can refer bugs in other projects | |
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' |
|
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' | |
505 |
|
505 | |||
506 | # Turn off email notifications |
|
506 | old_notified_events = Setting.notified_events | |
|
507 | begin | |||
|
508 | # Turn off email notifications temporarily | |||
507 | Setting.notified_events = [] |
|
509 | Setting.notified_events = [] | |
508 |
|
510 | # Run the migration | ||
509 | MantisMigrate.establish_connection db_params |
|
511 | MantisMigrate.establish_connection db_params | |
510 | MantisMigrate.migrate |
|
512 | MantisMigrate.migrate | |
|
513 | ensure | |||
|
514 | # Restore previous notification settings even if the migration fails | |||
|
515 | Setting.notified_events = old_notified_events | |||
|
516 | end | |||
|
517 | ||||
511 | end |
|
518 | end | |
512 | end |
|
519 | end |
@@ -762,10 +762,16 namespace :redmine do | |||||
762 | prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier} |
|
762 | prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier} | |
763 | puts |
|
763 | puts | |
764 |
|
764 | |||
765 | # Turn off email notifications |
|
765 | old_notified_events = Setting.notified_events | |
|
766 | begin | |||
|
767 | # Turn off email notifications temporarily | |||
766 | Setting.notified_events = [] |
|
768 | Setting.notified_events = [] | |
767 |
|
769 | # Run the migration | ||
768 | TracMigrate.migrate |
|
770 | TracMigrate.migrate | |
|
771 | ensure | |||
|
772 | # Restore previous notification settings even if the migration fails | |||
|
773 | Setting.notified_events = old_notified_events | |||
|
774 | end | |||
769 | end |
|
775 | end | |
770 | end |
|
776 | end | |
771 |
|
777 |
General Comments 0
You need to be logged in to leave comments.
Login now