anchor.diff:                          Doc2 = Doc,
                           GetDiskDocFun = LoadPrevRevFun
                       end,
  -                    
  +
                       case validate_doc_update(Db, Doc2, GetDiskDocFun) of
                       ok ->
                           {[Doc2 | AccValidated], AccErrors2};
  
positive.code:                 {ok, {Start, Path}} ->
                      % our unflushed doc is a leaf node. Go back on the path
                      % to find the previous rev that's on disk.
                      
                      LoadPrevRevFun = fun() ->
                                  make_first_doc_on_disk(Db,Id,Start-1, tl(Path))
                              end,
                      
                      case couch_doc:has_stubs(Doc) of
                      true ->
                          DiskDoc = LoadPrevRevFun(),
  
negative.code:         (Att) ->
              Att#att{revpos=RevPos+1}
          end, Atts)}.
  
  
  doc_flush_atts(Doc, Fd) ->
      Doc#doc{atts=[flush_att(Fd, Att) || Att <- Doc#doc.atts]}.
  