function _drush_upgrade_restore_preserved_modules

4.x upgrade.drush.inc _drush_upgrade_restore_preserved_modules()

Restore modules that were preserved by _drush_upgrade_preserve_modules.

2 calls to _drush_upgrade_restore_preserved_modules()
drush_upgrade_site_upgrade in commands/core/upgrade.drush.inc
Main command hook for site-upgrade.
drush_upgrade_site_upgrade_rollback in commands/core/upgrade.drush.inc
Rollback function: restore our modules if updatedb fails.

File

commands/core/upgrade.drush.inc, line 694
Refine your Drupal major version upgrade.

Code

function _drush_upgrade_restore_preserved_modules() {
  $modules_preserve = drush_get_context('DRUSH_MODULES_PRESERVE', array());

  if (!empty($modules_preserve) && array_key_exists('list', $modules_preserve)) {
    foreach ($modules_preserve['list'] as $moduledir => $preserved_moduledir) {
      drush_move_dir($preserved_moduledir, $moduledir, TRUE);
    }
  }
  drush_set_context('DRUSH_MODULES_PRESERVE', array());
}