anchor.diff:  
       % Check if we just updated any design documents, and update the validation
       % funs if we did.
  -    case lists:any(
  -        fun(<<"_design/", _/binary>>) -> true; (_) -> false end, Ids) of
  -    false ->
  -        Db4 = Db3;
  -    true ->
  -        Db4 = refresh_validate_doc_funs(Db3)
  -    end,
  -
  -    {ok, commit_data(Db4, not FullCommit)}.
  -
  +    Db4 = case UpdatedDDocIds of
  +    [] ->
  +        Db3;
  +    _ ->
  +        refresh_validate_doc_funs(Db3)
  +    end,
  +
  +    {ok, commit_data(Db4, not FullCommit), UpdatedDDocIds}.
   
   update_local_docs(Db, []) ->
       {ok, Db};
  
positive.code: 
  
  
  new_index_entries([], AccById, AccBySeq) ->
      {AccById, AccBySeq};
  new_index_entries([FullDocInfo|RestInfos], AccById, AccBySeq) ->
      #doc_info{revs=[#rev_info{deleted=Deleted}|_]} = DocInfo =
              couch_doc:to_doc_info(FullDocInfo),
      new_index_entries(RestInfos,
          [FullDocInfo#full_doc_info{deleted=Deleted}|AccById],
          [DocInfo|AccBySeq]).
  
  
  stem_full_doc_infos(#db{revs_limit=Limit}, DocInfos) ->
  
negative.code:     NonRepDocs2 = [{Client, NRDoc} || NRDoc <- NonRepDocs],
      try update_docs_int(Db, GroupedDocs3, NonRepDocs2, MergeConflicts,
                  FullCommit2) of
      {ok, Db2, UpdatedDDocIds} ->
          ok = gen_server:call(Db#db.main_pid, {db_updated, Db2}),
          if Db2#db.update_seq /= Db#db.update_seq ->
              couch_db_update_notifier:notify({updated, Db2#db.name});
          true -> ok
          end,
          [catch(ClientPid ! {done, self()}) || ClientPid <- Clients],
          lists:foreach(fun(DDocId) ->
              couch_db_update_notifier:notify({ddoc_updated, {Db#db.name, DDocId}})
          end, UpdatedDDocIds),
          {noreply, Db2}
      catch
          throw: retry ->
  