couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [1/2] fabric commit: updated refs/heads/master to a4d9852
Date Fri, 30 Jan 2015 18:10:50 GMT
Repository: couchdb-fabric
Updated Branches:
  refs/heads/master d89e00929 -> a4d985252


Don't do manual filtering of _design docs

Since namespace support was added we can rely on it instead

COUCHDB-1145


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

Branch: refs/heads/master
Commit: f44e627ed883f122bd9c78dc51b1578f13040423
Parents: 5930256
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Fri Dec 19 08:36:05 2014 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Fri Dec 19 08:36:12 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/f44e627e/src/fabric.erl
----------------------------------------------------------------------
diff --git a/src/fabric.erl b/src/fabric.erl
index ea07fbe..a7baacc 100644
--- a/src/fabric.erl
+++ b/src/fabric.erl
@@ -333,21 +333,15 @@ design_docs(DbName) ->
         undefined -> [];
         Else -> [{io_priority, Else}]
     end,
-    QueryArgs = #mrargs{
-        start_key = <<"_design/">>,
-        end_key = <<"_design0">>,
+    QueryArgs0 = #mrargs{
         include_docs=true,
         extra=Extra
     },
+    QueryArgs = set_namespace(<<"_design">>, QueryArgs0),
     Callback = fun({meta, _}, []) ->
         {ok, []};
     ({row, Props}, Acc) ->
-        case couch_util:get_value(id, Props) of
-        <<"_design/", _/binary>> ->
-            {ok, [couch_util:get_value(doc, Props) | Acc]};
-        _ ->
-            {stop, Acc}
-        end;
+        {ok, [couch_util:get_value(doc, Props) | Acc]};
     (complete, Acc) ->
         {ok, lists:reverse(Acc)};
     ({error, Reason}, _Acc) ->
@@ -505,3 +499,6 @@ kl_to_record(KeyList,RecName) ->
                     Index = lookup_index(couch_util:to_existing_atom(Key),RecName),
                     setelement(Index, Acc, Value)
                         end, Acc0, KeyList).
+
+set_namespace(NS, #mrargs{extra = Extra} = Args) ->
+    Args#mrargs{extra = [{namespace, NS} | Extra]}.


Mime
View raw message