anchor.diff:              0 -> AccRemoveSeqs;
               _ -> [OldSeq | AccRemoveSeqs]
           end,
  -        merge_rev_trees(MergeConflicts, RestDocsList, RestOldInfo,
  -                [NewInfo|AccNewInfos], RemoveSeqs, AccSeq+1)
  +        merge_rev_trees(Limit, MergeConflicts, RestDocsList, RestOldInfo,
  +            [NewInfo|AccNewInfos], RemoveSeqs, AccSeq+1)
       end.
   
   
  
positive.code:     #db{
          fulldocinfo_by_id_btree = DocInfoByIdBTree,
          docinfo_by_seq_btree = DocInfoBySeqBTree,
          update_seq = LastSeq
          } = Db,
      Ids = [Id || [{_Client, #doc{id=Id}}|_] <- DocsList],
      % lookup up the old documents, if they exist.
  
negative.code:     % used to send a result to the client
      catch(Client ! {result, self(), {{Id, OriginalRevs}, NewResult}}).
  
  merge_rev_trees(_Limit, _Merge, [], [], AccNewInfos, AccRemoveSeqs, AccSeq) ->
      {ok, lists:reverse(AccNewInfos), AccRemoveSeqs, AccSeq};
  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,
      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
  