couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [50/50] couch commit: updated refs/heads/windsor-merge to 6e60cbe
Date Thu, 07 Aug 2014 15:38:12 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/6e60cbe8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/6e60cbe8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/6e60cbe8

Branch: refs/heads/windsor-merge
Commit: 6e60cbe8809aecfc1eada3cbe25e4fa2e9867983
Parents: 4d02279
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Thu Jun 26 16:48:46 2014 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 7 16:36:02 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/6e60cbe8/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