anchor.diff:                      LogValue = {ViewId, {Key, UpdatedSeq, del}},
                       Log5 = dict:append(DocId, LogValue, Log4),
                       DelAcc5 = dict:append(ViewId, {Key, Seq, DocId}, DelAcc4),
  -                    AddValue = {{UpdatedSeq, Key}, {DocId, ?REM_VAL}},
  +                    Rev = dict:fetch(DocId, Revs),
  +                    AddValue = {{UpdatedSeq, Key}, {DocId, ?REM_VAL, Rev}},
                       AddAcc5 = dict:append(ViewId, AddValue, AddAcc4),
                       {Log5, AddAcc5, DelAcc5};
                   false ->
  
positive.code:             {[{Key, {dups, [Val1, Val2]}} | Rest], IdKeys, Log2};
          ({Key, Value}, {Rest, IdKeys, Log2}) ->
              {[{Key, Value} | Rest], [{Id, Key} | IdKeys],
               dict:append(DocId, {Id, {Key, Seq, add}}, Log2)}
      end,
      InitAcc = {[], VIdKeys, Log},
      couch_stats:increment_counter([couchdb, mrview, emits], length(KVs)),
  
negative.code:                     {Log5, AddAcc4, DelAcc4}
              end
          end, Acc, VIdKeys)
      end, {Log0, dict:new(), dict:new()}, KVsToLook),
  
      ToAdd = [{Id, DIKeys} || {Id, DIKeys} <- dict:to_list(Log1), DIKeys /= []],
      % store the new logs
  