couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [8/9] couch commit: updated refs/heads/windsor-merge to 2c36e16
Date Thu, 07 Aug 2014 17:57:25 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/2c36e164
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/2c36e164
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/2c36e164

Branch: refs/heads/windsor-merge
Commit: 2c36e1642d40da9a9f4b4c3cf52cf63317761fa7
Parents: 79decf0
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 18:55:10 2014 +0100

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


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