couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [27/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:12:03 GMT
Add couch_db_header:latest/1

This function returns false if it's supplied an integer less than the
?LATEST_DISK_VERSION, true if supplied ?LATEST_DISK_VERSION, and
undefined on any other input.

BugzID: 15762


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

Branch: refs/heads/master
Commit: 07731f3d3641973b9b937b2ab5e4e4fe6cf84444
Parents: b580899
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Thu Jun 26 16:48:46 2014 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00:01 2014 +0100

----------------------------------------------------------------------
 src/couch_db_header.erl | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/07731f3d/src/couch_db_header.erl
----------------------------------------------------------------------
diff --git a/src/couch_db_header.erl b/src/couch_db_header.erl
index 03f95ea..2d48434 100644
--- a/src/couch_db_header.erl
+++ b/src/couch_db_header.erl
@@ -26,6 +26,7 @@
     update_seq/1,
     id_tree_state/1,
     seq_tree_state/1,
+    latest/1,
     local_tree_state/1,
     purge_seq/1,
     purged_docs/1,
@@ -283,6 +284,12 @@ upgrade_compacted_seq(#db_header{}=Header) ->
             Header
     end.
 
+latest(?LATEST_DISK_VERSION) ->
+    true;
+latest(N) when is_integer(N), N < ?LATEST_DISK_VERSION ->
+    false;
+latest(_Else) ->
+    undefined.
 
 -ifdef(TEST).
 -include_lib("eunit/include/eunit.hrl").


Mime
View raw message