Index: trunk/ippTasks/diff.pro
===================================================================
--- trunk/ippTasks/diff.pro	(revision 26889)
+++ trunk/ippTasks/diff.pro	(revision 26961)
@@ -40,4 +40,7 @@
     active true
   end
+  task diff.revert
+    active false
+  end
 end
 
@@ -53,4 +56,19 @@
     active false
   end
+  task diff.revert
+    active false
+  end
+end
+
+macro diff.revert.on
+  task diff.revert
+    active true
+  end
+end
+
+macro diff.revert.off
+  task diff.revert
+    active false
+  end
 end
 
@@ -76,4 +94,7 @@
 ### Load tasks for doing the differences
 ### Tasks are loaded into diffSkyfile.
+
+$diff_revert_DB = 0
+
 task	       diff.skycell.load
   host         local
@@ -380,2 +401,48 @@
 #   end
 # end
+
+task diff.revert
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 120.0
+  npending     1
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = difftool -revertdiffskyfile 
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$diff_revert_DB
+      $run = $run -dbname $DB:$diff_revert_DB
+      $diff_revert_DB ++
+      if ($diff_revert_DB >= $DB:n) set diff_revert_DB = 0
+    end
+    add_poll_labels run
+    command $run
+  end
+
+  # success
+  task.exit    0
+  end
+
+  # locked list
+  task.exit    default
+    showcommand failure
+  end
+
+  task.exit    crash
+    showcommand crash
+  end
+
+  # operation times out?
+  task.exit    timeout
+    showcommand timeout
+  end
+end
