diff options
author | Damien F. Katz <damien@apache.org> | 2009-07-29 21:48:53 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-07-29 21:48:53 +0000 |
commit | a05287f49dc20ef83f89668f1d2603174823565e (patch) | |
tree | d1f3fe2dfeea71a8eb26666c9bb56a2b690c4cde /share/www/script/test | |
parent | be2828a00e2eba6be47df5648f4e589a43113dbe (diff) |
Fix for COUCHDB-434. Only reassign previous revid inside the updater process.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@799093 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test')
-rw-r--r-- | share/www/script/test/attachments.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js index ce7a5d05..4b6fa58e 100644 --- a/share/www/script/test/attachments.js +++ b/share/www/script/test/attachments.js @@ -170,7 +170,18 @@ couchTests.attachments= function(debug) { docs.push(doc) } - db.bulkSave(docs); + var saved = db.bulkSave(docs); + // now delete the docs, and while we are looping over them, remove the + // '_rev' field so we can re-create after deletion. + var to_up = []; + for (i=0;i<saved.length;i++) { + to_up.push({'_id': saved[i]['id'], '_rev': saved[i]['rev'], '_deleted': true}); + delete docs[i]._rev; + } + // delete them. + var saved2 = db.bulkSave(to_up); + // re-create them + var saved3 = db.bulkSave(docs); var before = db.info().disk_size; |