You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/12/16 21:57:18 UTC
[1/3] chttpd commit: updated refs/heads/master to c9d23bd
Repository: couchdb-chttpd
Updated Branches:
refs/heads/master f79302076 -> c9d23bdf4
Return error when open_revs=all and document doesn't exist
COUCHDB-2517
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/016ede4b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/016ede4b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/016ede4b
Branch: refs/heads/master
Commit: 016ede4b458db2e006914f5cd7d157fb42ff0733
Parents: b44515f
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Mon Dec 8 07:45:00 2014 -0800
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Mon Dec 15 12:22:09 2014 -0800
----------------------------------------------------------------------
src/chttpd_db.erl | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/016ede4b/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 24eb78c..79d832b 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -582,6 +582,10 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
undefined -> [];
AcceptHeader -> string:tokens(AcceptHeader, ", ")
end,
+ case Results of
+ [] when Revs == all ->
+ chttpd:send_error(Req, {not_found, missing});
+ _Else ->
case lists:member("multipart/mixed", AcceptedTypes) of
false ->
{ok, Resp} = start_json_response(Req, 200),
@@ -608,6 +612,7 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
true ->
send_docs_multipart(Req, Results, Options)
end
+ end
end;
db_doc_req(#httpd{method='POST', user_ctx=Ctx}=Req, Db, DocId) ->
[2/3] chttpd commit: updated refs/heads/master to c9d23bd
Posted by da...@apache.org.
Re-indent to reflect recent addtion of a case branch
COUCHDB-2517
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/c256e919
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/c256e919
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/c256e919
Branch: refs/heads/master
Commit: c256e919220b298b7ab14074a68c1ff91bacf12a
Parents: 016ede4
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Authored: Mon Dec 8 07:46:46 2014 -0800
Committer: ILYA Khlopotov <ii...@ca.ibm.com>
Committed: Mon Dec 15 12:22:33 2014 -0800
----------------------------------------------------------------------
src/chttpd_db.erl | 52 +++++++++++++++++++++++++-------------------------
1 file changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/c256e919/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 79d832b..e4510ae 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -586,32 +586,32 @@ db_doc_req(#httpd{method='GET'}=Req, Db, DocId) ->
[] when Revs == all ->
chttpd:send_error(Req, {not_found, missing});
_Else ->
- case lists:member("multipart/mixed", AcceptedTypes) of
- false ->
- {ok, Resp} = start_json_response(Req, 200),
- send_chunk(Resp, "["),
- % We loop through the docs. The first time through the separator
- % is whitespace, then a comma on subsequent iterations.
- lists:foldl(
- fun(Result, AccSeparator) ->
- case Result of
- {ok, Doc} ->
- JsonDoc = couch_doc:to_json_obj(Doc, Options),
- Json = ?JSON_ENCODE({[{ok, JsonDoc}]}),
- send_chunk(Resp, AccSeparator ++ Json);
- {{not_found, missing}, RevId} ->
- RevStr = couch_doc:rev_to_str(RevId),
- Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}),
- send_chunk(Resp, AccSeparator ++ Json)
- end,
- "," % AccSeparator now has a comma
- end,
- "", Results),
- send_chunk(Resp, "]"),
- end_json_response(Resp);
- true ->
- send_docs_multipart(Req, Results, Options)
- end
+ case lists:member("multipart/mixed", AcceptedTypes) of
+ false ->
+ {ok, Resp} = start_json_response(Req, 200),
+ send_chunk(Resp, "["),
+ % We loop through the docs. The first time through the separator
+ % is whitespace, then a comma on subsequent iterations.
+ lists:foldl(
+ fun(Result, AccSeparator) ->
+ case Result of
+ {ok, Doc} ->
+ JsonDoc = couch_doc:to_json_obj(Doc, Options),
+ Json = ?JSON_ENCODE({[{ok, JsonDoc}]}),
+ send_chunk(Resp, AccSeparator ++ Json);
+ {{not_found, missing}, RevId} ->
+ RevStr = couch_doc:rev_to_str(RevId),
+ Json = ?JSON_ENCODE({[{<<"missing">>, RevStr}]}),
+ send_chunk(Resp, AccSeparator ++ Json)
+ end,
+ "," % AccSeparator now has a comma
+ end,
+ "", Results),
+ send_chunk(Resp, "]"),
+ end_json_response(Resp);
+ true ->
+ send_docs_multipart(Req, Results, Options)
+ end
end
end;
[3/3] chttpd commit: updated refs/heads/master to c9d23bd
Posted by da...@apache.org.
Merge branch '2517-open_revs=all-function_clause'
Fixes #15
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/c9d23bdf
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/c9d23bdf
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/c9d23bdf
Branch: refs/heads/master
Commit: c9d23bdf45261ee2a2214e982f1a47a5de1f44cf
Parents: f793020 c256e91
Author: Paul J. Davis <pa...@gmail.com>
Authored: Tue Dec 16 14:57:06 2014 -0600
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Dec 16 14:57:06 2014 -0600
----------------------------------------------------------------------
src/chttpd_db.erl | 55 +++++++++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 25 deletions(-)
----------------------------------------------------------------------