public function drush_pm_version_control_bzr::rollback

4.x bzr.inc public drush_pm_version_control_bzr::rollback($project)

Implementation of rollback().

Overrides drush_pm_version_control::rollback

File

commands/pm/version_control/bzr.inc, line 39
Drush pm Bazaar extension

Class

drush_pm_version_control_bzr

Code

public function rollback($project) {
  if (drush_shell_exec('bzr revert %s', $project['full_project_path'])) {
    $output = drush_shell_exec_output();
    if (!empty($output)) {
      return drush_set_error('DRUSH_PM_BZR_LOCAL_CHANGES', dt("The Bazaar working copy at !path appears to have uncommitted changes (see below). Please commit or revert these changes before continuing:\n!output", array('!path' => $project['full_project_path'], '!output' => implode("\n", $output))));
    }
  }
  else {
    return drush_set_error('DRUSH_PM_BZR_NOT_FOUND', dt("Drush was unable to get the Bazaar status on !path. Check that you have Bazaar \ninstalled and that this directory is a Bazaar working copy.\nThe specific errors are below:\n!errors", array('!path' => $project['full_project_path'], '!errors' => implode("\n", drush_shell_exec_output()))));
  }
}