Index: trunk/ippTasks/publish.pro
===================================================================
--- trunk/ippTasks/publish.pro	(revision 27055)
+++ trunk/ippTasks/publish.pro	(revision 27072)
@@ -24,4 +24,7 @@
     active true
   end
+  task publish.revert
+    active true
+  end
 end
 
@@ -34,4 +37,20 @@
   end
   task publish.run
+    active false
+  end
+  task publish.revert
+    active false
+  end
+end
+
+
+macro publish.revert.on
+  task publish.revert
+    active true
+  end
+end
+
+macro publish.revert.off
+  task publish.revert
     active false
   end
@@ -42,4 +61,5 @@
 $publish_trigger_DB = 0
 $publish_load_DB = 0
+$publish_revert_DB = 0
 
 task	       publish.trigger
@@ -201,2 +221,50 @@
   end
 end
+
+
+task publish.revert
+  host         local
+
+  periods      -poll 5.0
+  periods      -exec 60.0
+  periods      -timeout 120.0
+  npending     1
+  active false
+
+  stdout NULL
+  stderr $LOGDIR/revert.log
+
+  task.exec
+    if ($LABEL:n == 0) break
+    $run = pubtool -revert
+    if ($DB:n == 0)
+      option DEFAULT
+    else
+      # save the DB name for the exit tasks
+      option $DB:$publish_revert_DB
+      $run = $run -dbname $DB:$publish_revert_DB
+      $publish_revert_DB ++
+      if ($publish_revert_DB >= $DB:n) set publish_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
