anchor.diff:              #doc_info{deleted=false} ->
                   {OldCountAcc + 1, OldDelCountAcc};
               _ ->
  -                {OldCountAcc , OldDelCountAcc + 1}
  +                {OldCountAcc, OldDelCountAcc + 1}
               end;
           (not_found, Acc) ->
               Acc
  
positive.code:     
      % Merge the new docs into the revision trees.
      NoConflicts = lists:member(no_conflicts, Options),
      {ok, NewRevTrees} = merge_rev_trees(NoConflicts, DocsList2, OldDocTrees, []),
      
      RemoveSeqs = [ OldSeq || {ok, #full_doc_info{update_seq=OldSeq}} <- OldDocLookups],
      
      % All regular documents are now ready to write.
      
  
negative.code: 
  flush_trees(_Db, [], AccFlushedTrees) ->
      {ok, lists:reverse(AccFlushedTrees)};
  flush_trees(#db{fd=Fd}=Db, [InfoUnflushed | RestUnflushed], AccFlushed) ->
          #full_doc_info{rev_tree=Unflushed} = InfoUnflushed,
          Flushed = couch_key_tree:map(
          fun(_Rev, Value) ->
              case Value of
              #doc{attachments=Atts,deleted=IsDeleted}=Doc ->
  