Index: trunk/ippScripts/scripts/magic_definerun.pl
===================================================================
--- trunk/ippScripts/scripts/magic_definerun.pl	(revision 20823)
+++ trunk/ippScripts/scripts/magic_definerun.pl	(revision 21006)
@@ -110,4 +110,5 @@
 print "$num_skyfiles skyfiles found for $exp_id\n" if $verbose;
 
+my $diff_id_for_run;
 if ($warp_id or $min_diff_id) {
     # filter the inputs
@@ -118,5 +119,5 @@
 
         if ($warp_id) {
-            if ($warp_id ne $sf->{warp_id_temp_0}) {;
+            if ($warp_id ne $sf->{warp1}) {;
                 $keep = 0;
             }
@@ -129,4 +130,5 @@
         if ( $keep) {
             $i++;
+            $diff_id_for_run = $sf->{diff_id} if !$diff_id_for_run;
         } else {
             # remove it
@@ -146,4 +148,5 @@
 {
     my $command = "$magictool -definerun -exp_id $exp_id -workdir $workdir -simple";
+    $command .= " -diff_id $diff_id_for_run" if defined $diff_id_for_run;
     $command .= " -label $label" if defined $label;
     $command .= " -dbname $dbname" if defined $dbname;
