anchor.diff:              end
           end,
           OldTree, NewDocs),
  +    NewRevTree = couch_key_tree:stem(NewRevTree0, Limit),
       if NewRevTree == OldTree ->
           % nothing changed
  -        merge_rev_trees(MergeConflicts, RestDocsList, RestOldInfo, AccNewInfos,
  -                AccRemoveSeqs, AccSeq);
  +        merge_rev_trees(Limit, 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},
  
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:         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.
  
  