couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject couch commit: updated refs/heads/master to fc9acc2
Date Sat, 26 Mar 2016 19:35:06 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/master 5fa909871 -> fc9acc2f3


Explicity use the {minor_version, 1} option with term_to_binary when calculating the revision
id.
This uses the 64-bit IEEE format for floats, making the binary representation consistent between
OTP versions before and after 17.0.
This also makes it easier for third parties to replicate the md5 portion of the revision id
calculation.


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

Branch: refs/heads/master
Commit: fc9acc2f35743fcb8077b71d7e292acf261143aa
Parents: 5fa9098
Author: Mike Fair <michael@daclubhouse.net>
Authored: Wed Mar 23 23:20:01 2016 -0700
Committer: Mike Fair <michael@daclubhouse.net>
Committed: Wed Mar 23 23:20:01 2016 -0700

----------------------------------------------------------------------
 src/couch_db.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/fc9acc2f/src/couch_db.erl
----------------------------------------------------------------------
diff --git a/src/couch_db.erl b/src/couch_db.erl
index 36c13af..1a9f669 100644
--- a/src/couch_db.erl
+++ b/src/couch_db.erl
@@ -873,7 +873,7 @@ new_revid(#doc{body=Body, revs={OldStart,OldRevs}, atts=Atts, deleted=Deleted})
             ?l2b(integer_to_list(couch_util:rand32()));
         Atts2 ->
             OldRev = case OldRevs of [] -> 0; [OldRev0|_] -> OldRev0 end,
-            couch_crypto:hash(md5, term_to_binary([Deleted, OldStart, OldRev, Body, Atts2]))
+            couch_crypto:hash(md5, term_to_binary([Deleted, OldStart, OldRev, Body, Atts2],
[{minor_version, 1}]))
     end.
 
 new_revs([], OutBuckets, IdRevsAcc) ->


Mime
View raw message