couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [36/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:12:12 GMT
Fix attachment revpos values


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/bca19942
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/bca19942
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/bca19942

Branch: refs/heads/master
Commit: bca19942ba754999063d03ef907d9026f6f300ef
Parents: fff5a3e
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Mon Aug 11 15:43:13 2014 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00:02 2014 +0100

----------------------------------------------------------------------
 src/couch_att.erl | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/bca19942/src/couch_att.erl
----------------------------------------------------------------------
diff --git a/src/couch_att.erl b/src/couch_att.erl
index e174c48..f0d2dd1 100644
--- a/src/couch_att.erl
+++ b/src/couch_att.erl
@@ -406,8 +406,9 @@ stub_from_json(Att, Props) ->
 follow_from_json(Att, Props) ->
     {DiskLen, EncodedLen, Encoding} = encoded_lengths_from_json(Props),
     Digest = digest_from_json(Props),
+    RevPos = couch_util:get_value(<<"revpos">>, Props, 0),
     store([
-        {md5, Digest}, {data, follows}, {disk_len, DiskLen},
+        {md5, Digest}, {revpos, RevPos}, {data, follows}, {disk_len, DiskLen},
         {att_len, EncodedLen}, {encoding, Encoding}
     ], Att).
 
@@ -416,7 +417,11 @@ inline_from_json(Att, Props) ->
     B64Data = couch_util:get_value(<<"data">>, Props),
     Data = base64:decode(B64Data),
     Length = size(Data),
-    store([{data, Data}, {disk_len, Length}, {att_len, Length}], Att).
+    RevPos = couch_util:get_value(<<"revpos">>, Props, 0),
+    store([
+        {data, Data}, {revpos, RevPos}, {disk_len, Length},
+        {att_len, Length}
+    ], Att).
 
 
 encoded_lengths_from_json(Props) ->


Mime
View raw message