anchor.diff:      end;
   decode_field(MsgDef, _MsgDefs, <<>>, {MsgName, Fields}) ->
       %% Reverse any repeated fields.
  -    RepeatedFNames = [N || #field{name=N, multiplicity=repeated} <- MsgDef],
  +    RepeatedFNames = [N || #field{name=N, occurrence=repeated} <- MsgDef],
       {MsgName, lists:foldl(fun(FName, Acc) ->
                                     OldValue = keyfetch(FName, Acc),
                                     NewValue = lists:reverse(OldValue),
  
positive.code:     %% http://code.google.com/apis/protocolbuffers/docs/encoding.html
      NewFields =
          case FieldDef of
              #field{name = FName, multiplicity = required, type={msg,FMsgName}}->
                  merge_field(FName, Value, Fields, FMsgName, MsgDefs);
              #field{name = FName, multiplicity = optional, type={msg,FMsgName}}->
                  merge_field(FName, Value, Fields, FMsgName, MsgDefs);
              #field{name = FName, multiplicity = required}->
                  replace_field(FName, Value, Fields);
              #field{name = FName, multiplicity = optional}->
                  replace_field(FName, Value, Fields);
              #field{name = FName, multiplicity = repeated} ->
                  append_to_field(FName, Value, Fields)
          end,
      decode_field(MsgDef, MsgDefs, Rest, {MsgName, NewFields}).
  
negative.code:     MsgDef = keyfetch(MsgName, MsgDefs),
      {MsgName,
       lists:foldl(
         fun(#field{name=FName, occurrence=repeated}, AccFields) ->
                 PrevSeq = keyfetch(FName, AccFields),
                 NewSeq = keyfetch(FName, NewFields),
                 replace_field(FName, append_seqs(PrevSeq, NewSeq), AccFields);
  