Index: commands/core/core.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/core.drush.inc,v
retrieving revision 1.153
diff -u -p -r1.153 core.drush.inc
--- commands/core/core.drush.inc	27 Dec 2010 16:15:55 -0000	1.153
+++ commands/core/core.drush.inc	29 Dec 2010 05:29:40 -0000
@@ -249,7 +249,9 @@ function drush_core_updatedb() {
   }
 
   drush_include_engine('drupal', 'update', drush_drupal_major_version());
-  update_main();
+  if (update_main() === FALSE) {
+    return FALSE;
+  }
 
   if (drush_drupal_major_version() <= 6) {
     // Clear all caches. We just performed major surgery.
Index: commands/core/field.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/field.drush.inc,v
retrieving revision 1.8
diff -u -p -r1.8 field.drush.inc
--- commands/core/field.drush.inc	27 Dec 2010 04:19:23 -0000	1.8
+++ commands/core/field.drush.inc	29 Dec 2010 05:29:40 -0000
@@ -145,7 +145,7 @@ function drush_field_delete($field_name)
     }
     else {
       if (!drush_confirm(dt('Do you want to delete the %field_name field?', array('%field_name' => $field_name)))) {
-        return drush_log(dt('Aborting.'));
+        return drush_user_abort();
       }
     }
   }
@@ -271,4 +271,4 @@ function drush_field_get_entity_from_bun
       }
     }
   }
-}
\ No newline at end of file
+}
Index: commands/core/rsync.core.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/rsync.core.inc,v
retrieving revision 1.9
diff -u -p -r1.9 rsync.core.inc
--- commands/core/rsync.core.inc	8 Dec 2010 14:58:47 -0000	1.9
+++ commands/core/rsync.core.inc	29 Dec 2010 05:29:41 -0000
@@ -47,7 +47,7 @@ function drush_core_rsync($source, $dest
       drush_print(dt("You will destroy data from !target and replace with data from !source", array('!source' => $source_path, '!target' => $destination_path)));
       if (!drush_confirm(dt('Do you really want to continue?'))) {
         // was: return drush_set_error('CORE_SYNC_ABORT', 'Aborting.');
-        drush_user_abort();
+        return drush_user_abort();
       }
     }
 
Index: commands/core/search.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/search.drush.inc,v
retrieving revision 1.6
diff -u -p -r1.6 search.drush.inc
--- commands/core/search.drush.inc	2 Apr 2010 04:14:49 -0000	1.6
+++ commands/core/search.drush.inc	29 Dec 2010 05:29:41 -0000
@@ -38,7 +38,7 @@ function _drush_core_search_status() {
 function drush_core_search_index() {
   drush_print(dt("Building the index may take a long time."));
   if (!drush_confirm(dt('Do you really want to continue?'))) {
-    return drush_set_error('CORE_SEARCH_REBUILD_ABORT', 'Aborting.');
+    return drush_user_abort();
   }
   drush_op('_drush_core_search_index');
   drush_log(dt('The search index has been built.'), 'ok');
@@ -70,7 +70,7 @@ function drush_core_search_reindex() {
     drush_print(dt("Rebuilding the index may take a long time."));
   }
   if (!drush_confirm(dt('Do you really want to continue?'))) {
-    return drush_set_error('CORE_SEARCH_REINDEX_ABORT', 'Aborting.');
+    return drush_user_abort();
   }
 
   if (drush_drupal_major_version() >= 7) {
Index: commands/core/site_install.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/site_install.drush.inc,v
retrieving revision 1.17
diff -u -p -r1.17 site_install.drush.inc
--- commands/core/site_install.drush.inc	23 Dec 2010 02:07:49 -0000	1.17
+++ commands/core/site_install.drush.inc	29 Dec 2010 05:29:41 -0000
@@ -27,7 +27,7 @@ function drush_core_pre_site_install() {
   $msg[] = dt("DROP your '@db' database and then CREATE a new one.", array('@db' => $db_spec['database']));
 
   if (!drush_confirm(dt('You are about to ') . implode(dt(' and '), $msg) . ' Do you want to continue?')) {
-    return drush_set_error('CORE_SITE_INSTALL_ABORT', 'Aborting.');
+    return drush_user_abort();
   }
 
   // Can't install without sites directory and settings.php.
Index: commands/core/watchdog.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/watchdog.drush.inc,v
retrieving revision 1.14
diff -u -p -r1.14 watchdog.drush.inc
--- commands/core/watchdog.drush.inc	24 Nov 2010 07:50:35 -0000	1.14
+++ commands/core/watchdog.drush.inc	29 Dec 2010 05:29:41 -0000
@@ -85,7 +85,7 @@ function drush_core_watchdog_list() {
   }
   $option = drush_choice($options, dt('Select a message type or severity level.'));
   if ($option === FALSE) {
-    return drush_log(dt('Aborting.'));
+    return drush_user_abort();
   }
   $ntypes = count($types);
   if ($option < $ntypes) {
@@ -144,7 +144,7 @@ function drush_core_watchdog_show_many($
 
   $where = core_watchdog_query($type, $severity, $filter);
   if ($where === FALSE) {
-    return drush_log(dt('Aborting.'));
+    return drush_set_error(dt('Aborting.'));
   }
   $rsc = drush_db_select('watchdog', '*', $where['where'], $where['args'], 0, $count, 'wid', 'DESC');
   if ($rsc === FALSE) {
@@ -289,11 +289,12 @@ function drush_core_watchdog_delete($arg
     }
     $where = core_watchdog_query($type, $severity, $arg, 'OR');
     if ($where === FALSE) {
+      // Drush set error was already called by core_watchdog_query
       return drush_log(dt('Aborting.'), 'error');
     }
     drush_print(dt('All messages with !where will be deleted.', array('!where' => preg_replace("/message LIKE %$arg%/", "message body containing '$arg'" , strtr($where['where'], $where['args'])))));
     if(!drush_confirm(dt('Do you really want to continue?'))) {
-      return drush_log(dt('Aborting.'));
+      return drush_user_abort();
     }
     $affected_rows = drush_db_delete('watchdog', $where['where'], $where['args']);
     drush_log(dt('!affected_rows watchdog messages have been deleted.', array('!affected_rows' => $affected_rows)), 'ok');
@@ -321,7 +322,7 @@ function core_watchdog_query($type = NUL
     $types = core_watchdog_message_types();
     if (array_search($type, $types) === FALSE) {
       $msg = "Unrecognized message type: !type.\nRecognized types are: !types.";
-      return drush_set_error(dt($msg, array('!type' => $type, '!types' => implode(', ', $types))));
+      return drush_set_error('WATCHDOG_UNRECOGNIZED_TYPE', dt($msg, array('!type' => $type, '!types' => implode(', ', $types))));
     }
     $conditions[] = "type = :type";
     $args[':type'] = $type;
Index: commands/core/drupal/update_5.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/update_5.inc,v
retrieving revision 1.9
diff -u -p -r1.9 update_5.inc
--- commands/core/drupal/update_5.inc	10 Nov 2010 02:55:41 -0000	1.9
+++ commands/core/drupal/update_5.inc	29 Dec 2010 05:29:41 -0000
@@ -80,7 +80,7 @@ function update_main() {
       }
     }
     if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
-      drush_user_abort();
+      return drush_user_abort();
     }
 
     $update_results = array();
Index: commands/core/drupal/update_6.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/update_6.inc,v
retrieving revision 1.19
diff -u -p -r1.19 update_6.inc
--- commands/core/drupal/update_6.inc	1 Dec 2010 15:53:15 -0000	1.19
+++ commands/core/drupal/update_6.inc	29 Dec 2010 05:29:41 -0000
@@ -403,7 +403,7 @@ function update_main() {
       }
     }
     if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
-      drush_user_abort();
+      return drush_user_abort();
     }
     // Proceed with running all pending updates.
     $operations = array();
Index: commands/core/drupal/update_7.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/core/drupal/update_7.inc,v
retrieving revision 1.29
diff -u -p -r1.29 update_7.inc
--- commands/core/drupal/update_7.inc	10 Nov 2010 02:55:41 -0000	1.29
+++ commands/core/drupal/update_7.inc	29 Dec 2010 05:29:42 -0000
@@ -234,7 +234,7 @@ function update_main() {
     }
 
     if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
-      drush_user_abort();
+      return drush_user_abort();
     }
 
     drush_update_batch($start);
Index: commands/pm/pm.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/pm/pm.drush.inc,v
retrieving revision 1.186
diff -u -p -r1.186 pm.drush.inc
--- commands/pm/pm.drush.inc	27 Dec 2010 15:46:16 -0000	1.186
+++ commands/pm/pm.drush.inc	29 Dec 2010 05:29:43 -0000
@@ -598,7 +598,7 @@ function drush_pm_enable() {
   else {
     drush_print(dt('The following extensions will be enabled: !extensions', array('!extensions' => implode(', ', $extensions))));
     if(!drush_confirm(dt('Do you really want to continue?'))) {
-      return drush_log(dt('Aborting.'));
+      return drush_user_abort();
     }
   }
 
@@ -712,7 +712,7 @@ function drush_pm_disable() {
   else {
     drush_print(dt('The following extensions will be disabled: !extensions', array('!extensions' => implode(', ', $extensions))));
     if(!drush_confirm(dt('Do you really want to continue?'))) {
-      return drush_log(dt('Aborting.'));
+      return drush_user_abort();
     }
   }
 
@@ -951,7 +951,7 @@ function drush_pm_uninstall() {
   else {
     drush_print(dt('The following modules will be uninstalled: !modules', array('!modules' => implode(', ', $modules))));
     if(!drush_confirm(dt('Do you really want to continue?'))) {
-      return drush_log(dt('Aborting.'));
+      return drush_user_abort();
     }
   }
 
@@ -2155,7 +2155,7 @@ function drush_pm_download() {
     // Check if install location already exists.
     if (is_dir($request['project_install_location'])) {
       if (!drush_confirm(dt('Install location !location already exists. Do you want to overwrite it?', array('!location' => $request['project_install_location'])))) {
-        drush_log(dt("Abort installation of !project to !dest.", array('!project' => $request['name'], '!dest' => $request['project_install_location'])), 'warning');
+        drush_log(dt("Skip installation of !project to !dest.", array('!project' => $request['name'], '!dest' => $request['project_install_location'])), 'warning');
         continue;
       }
     }
Index: commands/pm/updatecode.pm.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/pm/updatecode.pm.inc,v
retrieving revision 1.36
diff -u -p -r1.36 updatecode.pm.inc
--- commands/pm/updatecode.pm.inc	22 Dec 2010 23:13:10 -0000	1.36
+++ commands/pm/updatecode.pm.inc	29 Dec 2010 05:29:44 -0000
@@ -224,7 +224,7 @@ function _pm_update_core(&$project, $tmp
     _drush_pm_releasenotes(array('drupal'), TRUE, $tmpfile);
   }
   if(!drush_confirm(dt('Do you really want to continue?'))) {
-    drush_user_abort();
+    return drush_user_abort();
   }
 
   // We need write permission on $drupal_root.
@@ -364,7 +364,7 @@ function pm_update_packages($update_info
     drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));
   }
   if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {
-    drush_user_abort();
+    return drush_user_abort();
   }
 
   // Now we start the actual updating.
Index: commands/sql/sql.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/sql/sql.drush.inc,v
retrieving revision 1.86
diff -u -p -r1.86 sql.drush.inc
--- commands/sql/sql.drush.inc	25 Dec 2010 15:52:05 -0000	1.86
+++ commands/sql/sql.drush.inc	29 Dec 2010 05:29:44 -0000
@@ -454,7 +454,7 @@ function _drush_sql_query($query, $db_sp
 
 function drush_sql_drop() {
   if (!drush_confirm(dt('Do you really want to drop all tables?'))) {
-    drush_user_abort();
+    return drush_user_abort();
   }
   _drush_sql_drop();
 }
Index: commands/sql/sync.sql.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/commands/sql/sync.sql.inc,v
retrieving revision 1.46
diff -u -p -r1.46 sync.sql.inc
--- commands/sql/sync.sql.inc	24 Dec 2010 05:10:29 -0000	1.46
+++ commands/sql/sync.sql.inc	29 Dec 2010 05:29:45 -0000
@@ -290,7 +290,7 @@ function drush_sql_sync($source = NULL, 
       drush_print();
       drush_print(dt("You might want to make a backup first, using the sql-dump command.\n"));
       if (!drush_confirm(dt('Do you really want to continue?'))) {
-        drush_user_abort();
+        return drush_user_abort();
       }
     }
 
@@ -461,7 +461,10 @@ function drush_sql_post_sql_sync($source
           drush_print($messages);
           if (drush_get_option('confirm-sanitizations', FALSE)) {
             if (!drush_confirm(dt('Do you really want to sanitize?'))) {
-              drush_user_abort('Aborting; sql-sync completed, but sanitizations skipped.');
+	      // Do not abort or return FALSE; that would trigger a rollback.
+	      // Just skip the sanitizations and signal that all is ok.
+	      drush_log(dt('Sanitizations skipped.'), 'ok');
+	      return TRUE;
 	    }
 	  }
 	}
Index: includes/command.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/command.inc,v
retrieving revision 1.100
diff -u -p -r1.100 command.inc
--- includes/command.inc	27 Dec 2010 03:33:33 -0000	1.100
+++ includes/command.inc	29 Dec 2010 05:29:46 -0000
@@ -110,8 +110,10 @@ function drush_invoke($command) {
         call_user_func_array($func, $args);
         _drush_log_drupal_messages();
         if (drush_get_error()) {
-          drush_log(dt('An error occurred at function : @func', array('@func' => $func)), 'error');
-          $rollback = TRUE;
+          if (!drush_get_context('DRUSH_USER_ABORT', FALSE)) {
+	    drush_log(dt('An error occurred at function : @func', array('@func' => $func)), 'error');
+          }
+	  $rollback = TRUE;
 
           // break out of the foreach variations and foreach list
           break 2;
@@ -143,7 +145,7 @@ function drush_invoke($command) {
       if (function_exists($rb_func)) {
         call_user_func_array($rb_func, $args);
         _drush_log_drupal_messages();
-        drush_log("Changes for $func module have been rolled back.", 'rollback');
+        drush_log(dt("Changes for $func module have been rolled back."), 'rollback');
       }
     }
   }
Index: includes/drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/drush.inc,v
retrieving revision 1.178
diff -u -p -r1.178 drush.inc
--- includes/drush.inc	27 Dec 2010 03:33:33 -0000	1.178
+++ includes/drush.inc	29 Dec 2010 05:29:47 -0000
@@ -335,14 +335,6 @@ function drush_die($msg = NULL, $status 
   die($msg ? "drush: $msg\n" : '');
 }
 
-/**
- * Exit due to user declining a confirmation prompt.
- */
-function drush_user_abort($msg = NULL, $status = NULL) {
-  drush_set_context('DRUSH_USER_ABORT', TRUE);
-  drush_die($msg ? $msg : 'Aborting.', $status);
-}
-
 /*
  * Check to see if the provided line is a "#!/usr/bin/env drush"
  * "shebang" script line.
@@ -1677,7 +1669,7 @@ function drush_remote_command() {
       }
 
       if (drush_confirm('Continue? ') === FALSE) {
-         drush_user_abort();
+        return drush_user_abort();
       }
     }
     $command = array_shift($args);
@@ -1754,7 +1746,7 @@ function drush_do_multiple_command($comm
       }
 
       if (drush_confirm('Continue? ') === FALSE) {
-         drush_user_abort();
+         return drush_user_abort();
       }
     }
 
@@ -2218,7 +2210,7 @@ define('DRUSH_APPLICATION_ERROR', 255);
  *   Always returns FALSE, to allow you to return with false in the calling functions,
  *   such as <code>return drush_set_error('DRUSH_FRAMEWORK_ERROR')</code>
  */
-function drush_set_error($error, $message = null) {
+function drush_set_error($error, $message = null, $log_type = 'error') {
   $error_code =& drush_get_context('DRUSH_ERROR_CODE', DRUSH_SUCCESS);
   $error_code = DRUSH_FRAMEWORK_ERROR;
 
@@ -2235,7 +2227,7 @@ function drush_set_error($error, $messag
   }
 
   $error_log[$error][] = $message;
-  drush_log(($message) ? $message : $error, 'error', $error);
+  drush_log(($message) ? $message : $error, $log_type, $error);
 
   return FALSE;
 }
@@ -2279,6 +2271,18 @@ function drush_cmp_error($error) {
 }
 
 /**
+ * Exit due to user declining a confirmation prompt;
+ * calls through to drush_set_error('DRUSH_USER_ABORT', 'Aborting');
+ *
+ * Usage:  return drush_user_abort();
+ */
+function drush_user_abort($msg = NULL) {
+  drush_set_context('DRUSH_USER_ABORT', TRUE);
+  return drush_set_error('DRUSH_USER_ABORT', $msg ? $msg : dt('Aborting.'), 'ok');
+}
+
+
+/**
  * Turn PHP error handling off.
  *
  * This is commonly used while bootstrapping Drupal for install
