couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r659676 - /incubator/couchdb/trunk/src/couchdb/couch_db.erl
Date Fri, 23 May 2008 21:49:05 GMT
Author: damien
Date: Fri May 23 14:49:04 2008
New Revision: 659676

URL: http://svn.apache.org/viewvc?rev=659676&view=rev
Log:
fix for missing conflict check during serialized update

Modified:
    incubator/couchdb/trunk/src/couchdb/couch_db.erl

Modified: incubator/couchdb/trunk/src/couchdb/couch_db.erl
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/src/couchdb/couch_db.erl?rev=659676&r1=659675&r2=659676&view=diff
==============================================================================
--- incubator/couchdb/trunk/src/couchdb/couch_db.erl (original)
+++ incubator/couchdb/trunk/src/couchdb/couch_db.erl Fri May 23 14:49:04 2008
@@ -121,7 +121,7 @@
 
 delete_doc(MainPid, Id, Revisions) ->
     DeletedDocs = [#doc{id=Id, revs=[Rev], deleted=true} || Rev <- Revisions],
-    {ok, [Result]} = update_docs(MainPid, DeletedDocs, [new_edits]),
+    {ok, [Result]} = update_docs(MainPid, DeletedDocs, []),
     {ok, Result}.
 
 open_doc(MainPid, IdOrDocInfo) ->
@@ -291,13 +291,13 @@
     % flush unwritten binaries to disk.
     DocBuckets3 = [[doc_flush_binaries(Doc, Db#db.fd) || Doc <- Bucket] || Bucket <-
DocBuckets2],
 
-    case gen_server:call(MainPid, {update_docs, DocBuckets3, Options}) of
+    case gen_server:call(MainPid, {update_docs, DocBuckets3, [new_edits | Options]}) of
     ok -> {ok, NewRevs};
     retry ->
         Db2 = get_db(MainPid),
         DocBuckets4 = [[doc_flush_binaries(Doc, Db2#db.fd) || Doc <- Bucket] || Bucket
<- DocBuckets3],
         % We only retry once
-        case gen_server:call(MainPid, {update_docs, DocBuckets4, Options}) of
+        case gen_server:call(MainPid, {update_docs, DocBuckets4, [new_edits | Options]})
of
         ok -> {ok, NewRevs};
         Else -> throw(Else)
         end;
@@ -838,7 +838,7 @@
         end, {0, 0}, OldDocLookups),
     
     % Merge the new docs into the revision trees.
-    NoConflicts = lists:member(no_conflicts, Options),
+    NoConflicts = lists:member(new_edits, Options),
     {ok, NewDocInfos, NewSeq} = merge_rev_trees(NoConflicts, DocsList2, OldDocInfos, [],
LastSeq),
     
     RemoveSeqs =



Mime
View raw message