Fixes for COUCHDB-188 fix

On conflict, keep using the current revision tree.
Issue noticed by Paul Davis. Thanks.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ca51333f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ca51333f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ca51333f

Branch: refs/heads/master
Commit: ca51333f379204771fa225e21d110b3488c74ca5
Parents: 8d6363c
Author: Filipe David Borba Manana <fdman...@apache.org>
Authored: Tue Jan 17 20:36:05 2012 +0000
Committer: Filipe David Borba Manana <fdman...@apache.org>
Committed: Tue Jan 17 20:38:41 2012 +0000

----------------------------------------------------------------------
 src/couchdb/couch_db_updater.erl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ca51333f/src/couchdb/couch_db_updater.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl
index 0b890fe..54531db 100644
--- a/src/couchdb/couch_db_updater.erl
+++ b/src/couchdb/couch_db_updater.erl
@@ -597,7 +597,7 @@ merge_rev_trees(Limit, MergeConflicts, 
[NewDocs|RestDocsList],
                         {NewTree, OldDeleted};
                     true ->
                         send_result(Client, Ref, conflict),
-                        {NewTree, OldDeleted}
+                        {AccTree, OldDeleted}
                     end;
                 {NewTree, no_conflicts} when  AccTree == NewTree ->
                     % the tree didn't change at all
@@ -619,7 +619,7 @@ merge_rev_trees(Limit, MergeConflicts, 
[NewDocs|RestDocsList],
                         {NewTree2, OldDeleted};
                     true ->
                         send_result(Client, Ref, conflict),
-                        {NewTree, OldDeleted}
+                        {AccTree, OldDeleted}
                     end;
                 {NewTree, _} ->
                     {NewTree, NewDoc#doc.deleted}

Reply via email to