You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/08/11 22:43:36 UTC
couch commit: updated refs/heads/windsor-merge to b480af3
Repository: couchdb-couch
Updated Branches:
refs/heads/windsor-merge 1f1c8e1c0 -> b480af32f
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/b480af32
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/b480af32
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/b480af32
Branch: refs/heads/windsor-merge
Commit: b480af32fd0c4c69a94c8dfbe9de314bcecfd33b
Parents: 1f1c8e1
Author: Paul J. Davis <pa...@gmail.com>
Authored: Mon Aug 11 15:43:13 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Mon Aug 11 15:43:13 2014 -0500
----------------------------------------------------------------------
src/couch_att.erl | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b480af32/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) ->