anchor.diff:          {error, missing_source}
       end.
   
  -go(#db{name=DbName} = Db, #shard{} = Target, LocalId) ->
  +go(#db{name = DbName, seq_tree = Bt} = Db, #shard{} = Target, LocalId) ->
       erlang:put(io_priority, {internal_repl, DbName}),
       Seq = calculate_start_seq(Db, Target, LocalId),
       Acc0 = #acc{source=Db, target=Target, seq=Seq, localid=LocalId},
  -    Fun = fun ?MODULE:changes_enumerator/2,
  -    {ok, AccOut} = couch_db:changes_since(Db, all_docs, Seq, Fun, [], Acc0),
  +    Fun = fun ?MODULE:changes_enumerator/3,
  +    {ok, _LastReduction, AccOut} = couch_btree:fold(Bt, Fun, Acc0,
  +        [{start_key, Seq + 1}]),
       {ok, _} = replicate_batch(AccOut).
   
   make_local_id(#shard{node=SourceNode}, #shard{node=TargetNode}) ->
  
positive.code: -module(mem3_rep).
  
  -export([go/2, changes_enumerator/2, make_local_id/2]).
  
  -include("mem3.hrl").
  -include_lib("couch/include/couch_db.hrl").
  
negative.code:         0
      end.
  
  open_doc_revs(Db, #full_doc_info{id=Id, rev_tree=RevTree}, Revs) ->
      {FoundRevs, _} = couch_key_tree:get_key_leafs(RevTree, Revs),
      lists:map(fun({{IsDel, SummaryPtr, _Seq}, FoundRevPath}) ->
          couch_db:make_doc(Db, Id, IsDel, SummaryPtr, FoundRevPath)
      end, FoundRevs).
  
  iso8601_timestamp() ->
      {_,_,Micro} = Now = os:timestamp(),
      {{Year,Month,Date},{Hour,Minute,Second}} = calendar:now_to_datetime(Now),
  