Index: trunk/ippScripts/scripts/magic_destreak_revert.pl
===================================================================
--- trunk/ippScripts/scripts/magic_destreak_revert.pl	(revision 24786)
+++ trunk/ippScripts/scripts/magic_destreak_revert.pl	(revision 24856)
@@ -60,5 +60,5 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --magic_ds_id --camera --streaks --stage --stage_id --component --uri --path_base --outroot",
+pod2usage( -msg => "Required options: --magic_ds_id --camera --stage --stage_id --component --path_base --outroot",
            -exitval => 3) unless
     defined $magic_ds_id and
@@ -142,6 +142,6 @@
 
 
-my ($image, $mask, $ch_mask, $weight);
-my ($bimage, $bmask, $bch_mask, $bweight);
+my ($image, $mask, $ch_mask, $weight, $sources);
+my ($bimage, $bmask, $bch_mask, $bweight, $bsources);
 
 if ($stage eq "raw") {
@@ -171,7 +171,9 @@
     $mask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $path_base);
     $weight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $path_base);
+    $sources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $path_base);
     $bimage  = $ipprc->filename("PSWARP.OUTPUT", $backup_path_base);
     $bmask   = $ipprc->filename("PSWARP.OUTPUT.MASK", $backup_path_base);
     $bweight = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $backup_path_base);
+    $bsources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $backup_path_base);
 } elsif ($stage eq "diff") {
     my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images
@@ -179,7 +181,9 @@
     $mask   = $ipprc->filename("$name.MASK", $path_base);
     $weight = $ipprc->filename("$name.VARIANCE", $path_base);
+    $sources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base);
     $bimage  = $ipprc->filename($name, $backup_path_base);
     $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
     $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
+    $bsources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $backup_path_base);
 }
 
@@ -189,6 +193,4 @@
 # don't commit next the next couple of lines and see xxx below
 # change to if 0 to revert chip runs without masks
-if (0) {
-
 if ($mask) {
     if (!revert_file($mask, $bmask)) {
@@ -211,10 +213,13 @@
 } 
 
-# xxx don't commmit next line
-}
 
 if ($weight) {
     revert_file($weight, $bweight) or
         &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+}
+
+if ($sources) {
+    revert_file($sources, $bsources) or
+        &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
 }
 
