couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject svn commit: r1097082 - in /couchdb/trunk/src/couchdb: couch_db_updater.erl couch_doc.erl
Date Wed, 27 Apr 2011 11:03:15 GMT
Author: rnewson
Date: Wed Apr 27 11:03:15 2011
New Revision: 1097082

URL: http://svn.apache.org/viewvc?rev=1097082&view=rev
Log:
revert COUCHDB-1141 pending dev discussion.

Modified:
    couchdb/trunk/src/couchdb/couch_db_updater.erl
    couchdb/trunk/src/couchdb/couch_doc.erl

Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=1097082&r1=1097081&r2=1097082&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Wed Apr 27 11:03:15 2011
@@ -820,12 +820,8 @@ copy_docs(Db, #db{updater_fd = DestFd} =
             Info#full_doc_info{rev_tree=couch_key_tree:map(
                 fun(_, _, branch) ->
                     ?REV_MISSING;
-		(_Rev, LeafVal, leaf) when element(1, LeafVal) ->
-                    Seq = element(3, LeafVal),
-                    {ok, Pos, SummarySize} =
-                        couch_file:append_term_md5(DestFd, {{[]}, []}),
-                    {true, Pos, Seq, SummarySize};
                 (_Rev, LeafVal, leaf) ->
+                    IsDel = element(1, LeafVal),
                     Sp = element(2, LeafVal),
                     Seq = element(3, LeafVal),
                     {_Body, AttsInfo} = Summary = copy_doc_attachments(
@@ -835,7 +831,7 @@ copy_docs(Db, #db{updater_fd = DestFd} =
                     TotalLeafSize = lists:foldl(
                         fun({_, _, _, AttLen, _, _, _, _}, S) -> S + AttLen end,
                         SummarySize, AttsInfo),
-                    {false, Pos, Seq, TotalLeafSize}
+                    {IsDel, Pos, Seq, TotalLeafSize}
                 end, RevTree)}
         end, LookupResults),
 

Modified: couchdb/trunk/src/couchdb/couch_doc.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_doc.erl?rev=1097082&r1=1097081&r2=1097082&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_doc.erl (original)
+++ couchdb/trunk/src/couchdb/couch_doc.erl Wed Apr 27 11:03:15 2011
@@ -143,16 +143,11 @@ to_json_obj(#doc{id=Id,deleted=Del,body=
     }.
 
 from_json_obj({Props}) ->
-    clean_if_deleted(transfer_fields(Props, #doc{body=[]}));
+    transfer_fields(Props, #doc{body=[]});
 
 from_json_obj(_Other) ->
     throw({bad_request, "Document must be a JSON object"}).
 
-clean_if_deleted(#doc{deleted=true}=Doc) ->
-    Doc#doc{atts=[], body={[]}};
-clean_if_deleted(Doc) ->
-    Doc.
-
 parse_revid(RevId) when size(RevId) =:= 32 ->
     RevInt = erlang:list_to_integer(?b2l(RevId), 16),
      <<RevInt:128>>;



Mime
View raw message