private function drush_version_control_bzr::commit

8.0.x bzr.inc private drush_version_control_bzr::commit($project)
6.x bzr.inc private drush_version_control_bzr::commit($project)
7.x bzr.inc private drush_version_control_bzr::commit($project)
5.x bzr.inc private drush_version_control_bzr::commit($project)
master bzr.inc private drush_version_control_bzr::commit($project)

Automatically commit changes to the repository

2 calls to drush_version_control_bzr::commit()
drush_version_control_bzr::post_download in commands/pm/version_control/bzr.inc
Implementation of post_download().
drush_version_control_bzr::post_update in commands/pm/version_control/bzr.inc
Implementation of post_update().

File

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

Class

drush_version_control_bzr

Code

private function commit($project) {
  if (drush_get_option('bzrcommit')) {
    $message = drush_get_option('bzrmessage');
    if (empty($message)) {
      $message = dt("Drush automatic commit.\nProject: @name @type\nCommand: @arguments", array('@name' => $project['name'], '@type' => $project['project_type'], '@arguments' => implode(' ', $_SERVER['argv'])));
    }
    if (drush_shell_exec('bzr commit --message=%s %s', $message, $project['full_project_path'])) {
      drush_log(dt('Project committed to Bazaar successfully'), LogLevel::OK);
    }
    else {
      drush_set_error('DRUSH_PM_BZR_COMMIT_PROBLEMS', dt("Problems were encountered committing your changes to Bazaar.\nThe specific errors are below:\n!errors", array('!errors' => implode("\n", drush_shell_exec_output()))));
    }
  }
  else {
    drush_print(dt("You should consider committing the new code to your Bazaar repository.\nIf this version becomes undesireable, use Bazaar to roll back."));
  }
}