anchor.diff:      % used to send a result to the client
       catch(Client ! {result, self(), {{Id, OriginalRevs}, NewResult}}).
   
  -merge_rev_trees(_MergeConflicts, [], [], AccNewInfos, AccRemoveSeqs, AccSeq) ->
  +merge_rev_trees(_Limit, _Merge, [], [], AccNewInfos, AccRemoveSeqs, AccSeq) ->
       {ok, lists:reverse(AccNewInfos), AccRemoveSeqs, AccSeq};
  -merge_rev_trees(MergeConflicts, [NewDocs|RestDocsList],
  +merge_rev_trees(Limit, MergeConflicts, [NewDocs|RestDocsList],
           [OldDocInfo|RestOldInfo], AccNewInfos, AccRemoveSeqs, AccSeq) ->
       #full_doc_info{id=Id,rev_tree=OldTree,deleted=OldDeleted,update_seq=OldSeq}
               = OldDocInfo,
  -    NewRevTree = lists:foldl(
  +    NewRevTree0 = lists:foldl(
           fun({Client, #doc{revs={Pos,[_Rev|PrevRevs]}}=NewDoc}, AccTree) ->
               if not MergeConflicts ->
                   case couch_key_tree:merge(AccTree, [couch_db:doc_to_tree(NewDoc)]) of
  
positive.code:             end
          end,
          OldTree, NewDocs),
      if NewRevTree == OldTree ->
          % nothing changed
          merge_rev_trees(MergeConflicts, RestDocsList, RestOldInfo, AccNewInfos,
                  AccRemoveSeqs, AccSeq);
      true ->
          % we have updated the document, give it a new seq #
          NewInfo = #full_doc_info{id=Id,update_seq=AccSeq+1,rev_tree=NewRevTree},
  
negative.code:         end,
          Ids, OldDocLookups),
      % Merge the new docs into the revision trees.
      {ok, NewFullDocInfos, RemoveSeqs, NewSeq} = merge_rev_trees(RevsLimit,
              MergeConflicts, DocsList, OldDocInfos, [], [], LastSeq),
  
      % All documents are now ready to write.
  
  