From 3d96395f24baf66956de819a83bd3615ba45d721 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 18 Aug 2009 15:17:29 +0000 Subject: unset new config values on run_on_modified_server rollback git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@805445 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_tests.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'share/www/script') diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index 802db6f8..255c0228 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -117,10 +117,16 @@ function run_on_modified_server(settings, fun) { // 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"} + }); + } } } } -- cgit v1.2.3