You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ii...@apache.org on 2016/06/23 17:51:55 UTC

[1/5] couch commit: updated refs/heads/master to 1bcf525

Repository: couchdb-couch
Updated Branches:
  refs/heads/master 411c130ea -> 1bcf52545


Dead code elimination


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

Branch: refs/heads/master
Commit: 1727985212cf2658f5c46a26f8ac57046af188aa
Parents: 411c130
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Jun 22 10:29:11 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Wed Jun 22 10:29:11 2016 -0700

----------------------------------------------------------------------
 src/couch_changes.erl | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/17279852/src/couch_changes.erl
----------------------------------------------------------------------
diff --git a/src/couch_changes.erl b/src/couch_changes.erl
index 75ec1cd..beac089 100644
--- a/src/couch_changes.erl
+++ b/src/couch_changes.erl
@@ -804,25 +804,19 @@ changes_row(Results, DocInfo, Acc) ->
 maybe_get_changes_doc(Value, #changes_acc{include_docs=true}=Acc) ->
     #changes_acc{
         db = Db,
-        include_docs = IncDoc,
         doc_options = DocOpts,
         conflicts = Conflicts
     } = Acc,
-    case IncDoc of
-        true ->
-            Opts = case Conflicts of
-                true -> [deleted, conflicts];
-                false -> [deleted]
-            end,
-            Doc = couch_index_util:load_doc(Db, Value, Opts),
-            case Doc of
-                null ->
-                    [{doc, null}];
-                _ ->
-                    [{doc, couch_doc:to_json_obj(Doc, DocOpts)}]
-            end;
-        false ->
-            []
+    Opts = case Conflicts of
+        true -> [deleted, conflicts];
+        false -> [deleted]
+    end,
+    Doc = couch_index_util:load_doc(Db, Value, Opts),
+    case Doc of
+        null ->
+            [{doc, null}];
+        _ ->
+            [{doc, couch_doc:to_json_obj(Doc, DocOpts)}]
     end;
 maybe_get_changes_doc(_Value, _Acc) ->
     [].


[4/5] couch commit: updated refs/heads/master to 1bcf525

Posted by ii...@apache.org.
Remove dead code

{error, Reason} handling has been removed since teach_ddoc function
never returns it.


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

Branch: refs/heads/master
Commit: 87c4afc5c83f63c83ae259af8e1736f06e36b020
Parents: 8cab28a
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Jun 22 10:30:33 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Wed Jun 22 10:30:33 2016 -0700

----------------------------------------------------------------------
 src/couch_proc_manager.erl | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/87c4afc5/src/couch_proc_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_proc_manager.erl b/src/couch_proc_manager.erl
index 0dad679..33cc1e5 100644
--- a/src/couch_proc_manager.erl
+++ b/src/couch_proc_manager.erl
@@ -371,13 +371,8 @@ new_proc(Client) ->
     Resp = try
         case new_proc_int(From, Lang) of
         {ok, NewProc} ->
-            case teach_ddoc(DDoc, DDocKey, NewProc) of
-            {ok, Proc} ->
-                {spawn_ok, Proc, From};
-            {error, Reason} ->
-                gen_server:reply(From, {error, Reason}),
-                spawn_error
-            end;
+            {ok, Proc} = teach_ddoc(DDoc, DDocKey, NewProc),
+            {spawn_ok, Proc, From};
         Error ->
             gen_server:reply(From, {error, Error}),
             spawn_error


[5/5] couch commit: updated refs/heads/master to 1bcf525

Posted by ii...@apache.org.
Merge remote branch 'cloudant:fix_some_specs'

This closes #179

Signed-off-by: ILYA Khlopotov <ii...@ca.ibm.com>


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

Branch: refs/heads/master
Commit: 1bcf525451b743747fdfb4a2b7bce12b7d1932e2
Parents: 411c130 87c4afc
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Thu Jun 23 10:51:39 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Thu Jun 23 10:51:39 2016 -0700

----------------------------------------------------------------------
 src/couch_changes.erl      | 26 ++++++++++----------------
 src/couch_key_tree.erl     |  4 ++--
 src/couch_proc_manager.erl | 24 +++++++++++-------------
 3 files changed, 23 insertions(+), 31 deletions(-)
----------------------------------------------------------------------



[2/5] couch commit: updated refs/heads/master to 1bcf525

Posted by ii...@apache.org.
Fix couch_key_tree:merge_extend arg types


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

Branch: refs/heads/master
Commit: e9c9bb404bb7aec2798c21bef2b23701fee384db
Parents: 1727985
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Jun 22 10:29:47 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Wed Jun 22 10:29:47 2016 -0700

----------------------------------------------------------------------
 src/couch_key_tree.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/e9c9bb40/src/couch_key_tree.erl
----------------------------------------------------------------------
diff --git a/src/couch_key_tree.erl b/src/couch_key_tree.erl
index 6f62058..bc4076a 100644
--- a/src/couch_key_tree.erl
+++ b/src/couch_key_tree.erl
@@ -174,8 +174,8 @@ merge_at([Tree | Sibs], 0, INodes) ->
         fail -> fail
     end.
 
--spec merge_extend(tree(), tree()) ->
-                {tree(), new_leaf | new_branch | internal_node}.
+-spec merge_extend(revtree(), revtree()) ->
+                {revtree(), new_leaf | new_branch | internal_node}.
 merge_extend([], B) when B =/= [] ->
     % Most likely the insert branch simply extends this one, so the new
     % branch is exactly B. Its also possible that B is a branch because


[3/5] couch commit: updated refs/heads/master to 1bcf525

Posted by ii...@apache.org.
Fix some dialyzer warnings


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

Branch: refs/heads/master
Commit: 8cab28a70b3455f481eae61a8a51501d6796996d
Parents: e9c9bb4
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Wed Jun 22 10:30:19 2016 -0700
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Wed Jun 22 10:30:19 2016 -0700

----------------------------------------------------------------------
 src/couch_proc_manager.erl | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/8cab28a7/src/couch_proc_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_proc_manager.erl b/src/couch_proc_manager.erl
index a6c9746..0dad679 100644
--- a/src/couch_proc_manager.erl
+++ b/src/couch_proc_manager.erl
@@ -52,12 +52,15 @@
     soft_limit
 }).
 
+-type docid() :: iodata().
+-type revision() :: {integer(), binary()}.
+
 -record(client, {
-    timestamp,
-    from,
-    lang,
-    ddoc,
-    ddoc_key
+    timestamp :: os:timestamp() | '_',
+    from :: undefined | {pid(), reference()}  | '_',
+    lang :: binary() | '_',
+    ddoc :: #doc{} | '_',
+    ddoc_key :: undefined | {DDocId :: docid(), Rev :: revision()} | '_'
 }).
 
 -record(proc_int, {
@@ -519,7 +522,7 @@ flush_waiters(State, Lang) ->
 add_waiting_client(Client) ->
     ets:insert(?WAITERS, Client#client{timestamp=os:timestamp()}).
 
-
+-spec get_waiting_client(Lang :: binary()) -> undefined | #client{}.
 get_waiting_client(Lang) ->
     case ets:match_object(?WAITERS, #client{lang=Lang, _='_'}, 1) of
         '$end_of_table' ->