Author: jan
Date: Tue Aug 18 15:17:29 2009
New Revision: 805445

URL: http://svn.apache.org/viewvc?rev=805445&view=rev
Log:
unset new config values on run_on_modified_server rollback

Modified:
    couchdb/trunk/share/www/script/couch_tests.js

Modified: couchdb/trunk/share/www/script/couch_tests.js
URL: 
http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_tests.js?rev=805445&r1=805444&r2=805445&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/couch_tests.js [utf-8] Tue Aug 18 15:17:29 
2009
@@ -117,10 +117,16 @@
     // unset the settings
     for(var j=0; j < i; j++) {
       var s = settings[j];
-      CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
-        body: s.oldValue,
-        headers: {"X-Couch-Persist": "false"}
-      });
+      if(s.oldValue == "\"\"\n") { // unset value
+        CouchDB.request("DELETE", "/_config/" + s.section + "/" + s.key, {
+          headers: {"X-Couch-Persist": "false"}
+        });
+      } else {
+        CouchDB.request("PUT", "/_config/" + s.section + "/" + s.key, {
+          body: s.oldValue,
+          headers: {"X-Couch-Persist": "false"}
+        });
+      }
     }
   }
 }


Reply via email to