? .drush-cache.info
? includes/table.inc
Index: examples/example.aliases.drushrc.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/examples/example.aliases.drushrc.php,v
retrieving revision 1.6
diff -u -p -r1.6 example.aliases.drushrc.php
--- examples/example.aliases.drushrc.php	30 Dec 2010 15:45:18 -0000	1.6
+++ examples/example.aliases.drushrc.php	30 Dec 2010 19:57:15 -0000
@@ -156,7 +156,7 @@
  *       in the site alias record.
  * - 'command-specific': These options will only be set if the alias
  *   is used with the specified command.  In the example below, the option
- *   `--skip-tables-list=comments` will be selected whenever the @stage alias
+ *   `--no-cache` will be selected whenever the @stage alias
  *   is used in any of the following ways:
  *      drush @stage sql-sync @self @live
  *      drush sql-sync @stage @live
@@ -165,6 +165,12 @@
  *   (source and destination) take precedence over command-specific options
  *   in the bootstrapped site, and command-specific options in a destination
  *   alias will take precedence over those in a source alias.
+ * - 'source-command-specific' and 'target-command-specific': Behaves exactly
+ *   like the 'command-specific' option, but is applied only if the alias
+ *   is used as the source or target, respectively, of an rsync or sql-sync
+ *   command.  In the example below, `--skip-tables-list=comments` whenever
+ *   the alias @live is the target of an sql-sync command, but comments will
+ *   be included if @live is the source for the sql-sync command.
  * Some examples appear below.  Remove the leading hash signs to enable.
  */
 #$aliases['stage'] = array(
@@ -182,7 +188,7 @@
 #     ),
 #     'command-specific' => array (
 #       'sql-sync' => array (
-#         'skip-tables-list' => 'comments',
+#         'no-cache' => TRUE,
 #       ),
 #     ),
 #  );
@@ -197,4 +203,9 @@
 #$aliases['live'] = array(
 #    'parent' => '@server,@dev',
 #    'uri' => 'mydrupalsite.com',
+#     'target-command-specific' => array (
+#       'sql-sync' => array (
+#         'skip-tables-list' => 'comments',
+#       ),
+#     ),
 #  );
Index: includes/sitealias.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drush/includes/sitealias.inc,v
retrieving revision 1.69
diff -u -p -r1.69 sitealias.inc
--- includes/sitealias.inc	27 Dec 2010 18:36:33 -0000	1.69
+++ includes/sitealias.inc	30 Dec 2010 19:57:17 -0000
@@ -1336,6 +1336,19 @@ function drush_sitealias_set_alias_conte
     $skip_list[] = 'remote-host';
     $skip_list[] = 'remote-user';
   }
+  // If prefix is set, then copy from the 'prefix-' version
+  // of the drush special keys ('command-specific', 'path-aliases')
+  // into the ordinary version.  This will allow us to set
+  // 'source-command-specific' options that will only apply when
+  // the alias is used as the source option for rsync or sql-sync.
+  if (!empty($prefix)) {
+    $special_contexts = drush_get_special_keys();
+    foreach ($special_contexts as $option_name) {
+      if (array_key_exists($prefix . $option_name, $site_alias_settings)) {
+        $site_alias_settings[$option_name] = array_key_exists($option_name, $site_alias_settings) ? array_merge($site_alias_settings[$option_name], $site_alias_settings[$prefix . $option_name]) : $site_alias_settings[$prefix . $option_name];
+      }
+    }
+  }
   // Transfer all options from the site alias to the drush options
   // in the 'alias' context.
   foreach ($site_alias_settings as $key => $value) {
@@ -1352,6 +1365,10 @@ function drush_sitealias_set_alias_conte
         }
       }
     }
+    // Special handling for command-specific
+    elseif ($key == "command-specific") {
+      $options[$key] = $value;
+    }
     elseif (!in_array($key, $skip_list)) {
       $options[$prefix . $key] = $value;
     }
