You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2013/10/03 16:11:41 UTC

[41/50] [abbrv] git commit: updated refs/heads/1867-feature-plugins to 95d6e35

move couch_version() to couch_server:couch_version(short)


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

Branch: refs/heads/1867-feature-plugins
Commit: b6eba9e341af62e9a412239a5dc587d487aa3ace
Parents: ba8b68f
Author: Jan Lehnardt <ja...@apache.org>
Authored: Sat Aug 3 15:19:13 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Thu Oct 3 16:08:37 2013 +0200

----------------------------------------------------------------------
 src/couch_plugins/src/couch_plugins.erl | 4 +---
 src/couchdb/couch_server.erl            | 7 ++++++-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b6eba9e3/src/couch_plugins/src/couch_plugins.erl
----------------------------------------------------------------------
diff --git a/src/couch_plugins/src/couch_plugins.erl b/src/couch_plugins/src/couch_plugins.erl
index 507f114..2b110bc 100644
--- a/src/couch_plugins/src/couch_plugins.erl
+++ b/src/couch_plugins/src/couch_plugins.erl
@@ -264,9 +264,7 @@ does_file_exist({error, enoent}) -> false;
 does_file_exist(_Else) -> true.
 
 couchdb_version() ->
-  %% strip git hash from version string
-  [Version|_Rest] = string:tokens(couch_server:get_version(), "+"),
-  Version.
+  couch_server:get_version(short).
 
 % installing a plugin:
 %  - POST /_plugins -d {plugin-def}

http://git-wip-us.apache.org/repos/asf/couchdb/blob/b6eba9e3/src/couchdb/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index 4aceb55..7cee0f5 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -13,7 +13,7 @@
 -module(couch_server).
 -behaviour(gen_server).
 
--export([open/2,create/2,delete/2,get_version/0,get_uuid/0]).
+-export([open/2,create/2,delete/2,get_version/0,get_version/1,get_uuid/0]).
 -export([all_databases/0, all_databases/2]).
 -export([init/1, handle_call/3,sup_start_link/0]).
 -export([handle_cast/2,code_change/3,handle_info/2,terminate/2]).
@@ -42,6 +42,11 @@ get_version() ->
     false ->
         "0.0.0"
     end.
+get_version(short) ->
+  %% strip git hash from version string
+  [Version|_Rest] = string:tokens(get_version(), "+"),
+  Version.
+
 
 get_uuid() ->
     case couch_config:get("couchdb", "uuid", nil) of