function drush_pm_updatecode_rollback

8.0.x updatecode.pm.inc drush_pm_updatecode_rollback()
6.x updatecode.pm.inc drush_pm_updatecode_rollback()
7.x updatecode.pm.inc drush_pm_updatecode_rollback()
3.x updatecode.pm.inc drush_pm_updatecode_rollback()
4.x updatecode.pm.inc drush_pm_updatecode_rollback()
5.x updatecode.pm.inc drush_pm_updatecode_rollback()
master updatecode.pm.inc drush_pm_updatecode_rollback()

Rollback the update process.

File

commands/pm/updatecode.pm.inc, line 376
pm-updatecode command implementation.

Code

function drush_pm_updatecode_rollback() {
  $projects = array_reverse(drush_get_context('DRUSH_PM_UPDATED', array()));
  foreach ($projects as $project) {
    drush_log(dt('Rolling back update of !project code ...', array('!project' => $project['title'])));

    // Check we have a version control system, and it clears it's pre-flight.
    if (!$version_control = drush_pm_include_version_control($project['path'])) {
      return FALSE;
    }
    $version_control->rollback($project);
  }

  // Post rollback, we will do additional repair if the project is drupal core.
  $drupal_core = drush_get_context('DRUSH_PM_DRUPAL_CORE', FALSE);
  if ($drupal_core) {
    $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
    _pm_update_move_files($drupal_core['full_project_path'], $drupal_root, $drupal_core['skip_list']);
    drush_delete_dir($drupal_core['full_project_path']);
  }
}