From a05287f49dc20ef83f89668f1d2603174823565e Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Wed, 29 Jul 2009 21:48:53 +0000 Subject: 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 --- share/www/script/test/attachments.js | 13 ++++++++++++- src/couchdb/couch_db.erl | 8 +------- 2 files changed, 13 insertions(+), 8 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 % new doc, and we have existing revs. % reuse existing deleted doc - if OldFullDocInfo#full_doc_info.deleted -> - % existing docs are deletions - #doc_info{revs=[#rev_info{rev={Pos, DelRevId}}|_]} = - couch_doc:to_doc_info(OldFullDocInfo), - Doc2 = Doc#doc{revs={Pos, [DelRevId]}}, - {validate_doc_update(Db, Doc2, fun() -> nil end), Doc2}; - AllowConflict -> + if OldFullDocInfo#full_doc_info.deleted orelse AllowConflict -> {validate_doc_update(Db, Doc, fun() -> nil end), Doc}; true -> {conflict, Doc} -- cgit v1.2.3