couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [19/26] couch commit: updated refs/heads/windsor-merge to 14dc5e9
Date Tue, 26 Aug 2014 09:46:14 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/fdbf505d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/fdbf505d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/fdbf505d

Branch: refs/heads/windsor-merge
Commit: fdbf505da78fa425987a4492073a0133467a057b
Parents: 093454d
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: Tue Aug 26 10:44:12 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/fdbf505d/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