anchor.diff:      case rep_state(RepId) of
       nil ->
           ok;
  -    #rep_state{rep = #rep{doc_id = DocId}} ->
  +    #rep_state{rep = #rep{db_name = DbName, doc_id = DocId}} ->
           ok = gen_server:call(?MODULE, {rep_complete, RepId}, infinity),
  -        couch_log:notice("Replication `~s` usurped by ~s (triggered by document `~s`)",
  -            [pp_rep_id(RepId), By, DocId])
  +        couch_log:notice("Replication `~s` usurped by ~s (triggered by document"
  +            " `~s` from `~s`)", [pp_rep_id(RepId), By, DocId, DbName])
       end.
   
   
  
positive.code:     _ ->
          Reason = to_binary(Error)
      end,
      couch_log:error("Replication manager, error processing document `~s`: ~s",
          [DocId, Reason]),
      update_rep_doc(DbName, DocId, [{<<"_replication_state">>, <<"error">>},
                             {<<"_replication_state_reason">>, Reason}]).
  
  
negative.code:             {<<"_replication_id">>, ?l2b(BaseId)},
              {<<"_replication_stats">>, undefined}]),
          ok = gen_server:call(?MODULE, {rep_started, RepId}, infinity),
          couch_log:notice("Document `~s` from `~s` triggered replication `~s`",
              [DocId, DbName, pp_rep_id(RepId)])
      end.
  
  
  