anchor.diff:  -define(CTX, {user_ctx, #user_ctx{roles=[<<"_admin">>, <<"_replicator">>]}}).
   
   -define(replace(L, K, V), lists:keystore(K, 1, L, {K, V})).
  +
  +-define(RELISTEN_DELAY, 5000).
   
   -record(rep_state, {
       rep,
  
positive.code: 
  
  handle_config_change("replicator", "max_replication_retry_count", V, _, S) ->
      ok = gen_server:cast(S, {set_max_retries, retries_value(V)}),
      {ok, S};
  handle_config_change(_, _, _, _, S) ->
      {ok, S}.
  
  handle_config_terminate(_, stop, _) -> ok;
  handle_config_terminate(Self, _, _) ->
      spawn(fun() ->
          timer:sleep(5000),
          config:listen_for_changes(?MODULE, Self)
      end).
  
  init(_) ->
      process_flag(trap_exit, true),
  
negative.code: 
  handle_info(shutdown, State) ->
      {stop, shutdown, State};
  
  handle_info(restart_config_listener, State) ->
      ok = config:listen_for_changes(?MODULE, nil),
      {noreply, State};
  
  handle_info(Msg, State) ->
      couch_log:error("Replication manager received unexpected message ~p", [Msg]),
  