summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_rep_changes_feed.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-09-30 12:03:15 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-09-30 12:03:15 +0000
commit6ae13b5f8b827bc87a8cf3306c3caa1b97e49df3 (patch)
tree9662164348a314705094f5f52456ab7bfe330df9 /src/couchdb/couch_rep_changes_feed.erl
parent1c0a6e9c637fcfec2990c6318b3c69e4c7591d76 (diff)
Removing ?getv macros.
With OTP releases up to R13B03 it's not possible to define a 2 macro functions with the same name and different arities. (Only allowed in R13B04 and R14). git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1003025 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_rep_changes_feed.erl')
-rw-r--r--src/couchdb/couch_rep_changes_feed.erl30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/couchdb/couch_rep_changes_feed.erl b/src/couchdb/couch_rep_changes_feed.erl
index 773a2ced..7f7d3a38 100644
--- a/src/couchdb/couch_rep_changes_feed.erl
+++ b/src/couchdb/couch_rep_changes_feed.erl
@@ -48,7 +48,7 @@ stop(Server) ->
init([Parent, #http_db{}=Source, Since, PostProps]) ->
process_flag(trap_exit, true),
- Feed = case ?getv(<<"continuous">>, PostProps, false) of
+ Feed = case couch_util:get_value(<<"continuous">>, PostProps, false) of
false ->
normal;
true ->
@@ -60,11 +60,11 @@ init([Parent, #http_db{}=Source, Since, PostProps]) ->
{"since", Since},
{"feed", Feed}
],
- QS = case ?getv(<<"filter">>, PostProps) of
+ QS = case couch_util:get_value(<<"filter">>, PostProps) of
undefined ->
BaseQS;
FilterName ->
- {Params} = ?getv(<<"query_params">>, PostProps, {[]}),
+ {Params} = couch_util:get_value(<<"query_params">>, PostProps, {[]}),
lists:foldr(
fun({K, V}, QSAcc) ->
Ks = couch_util:to_list(K),
@@ -126,8 +126,8 @@ init([_Parent, Source, Since, PostProps] = InitArgs) ->
ChangesArgs = #changes_args{
style = all_docs,
since = Since,
- filter = ?b2l(?getv(<<"filter">>, PostProps, <<>>)),
- feed = case ?getv(<<"continuous">>, PostProps, false) of
+ filter = ?b2l(couch_util:get_value(<<"filter">>, PostProps, <<>>)),
+ feed = case couch_util:get_value(<<"continuous">>, PostProps, false) of
true ->
"continuous";
false ->
@@ -150,11 +150,11 @@ init([_Parent, Source, Since, PostProps] = InitArgs) ->
{ok, #state{changes_loop=ChangesPid, init_args=InitArgs}}.
filter_json_req(Db, PostProps) ->
- case ?getv(<<"filter">>, PostProps) of
+ case couch_util:get_value(<<"filter">>, PostProps) of
undefined ->
{[]};
FilterName ->
- {Query} = ?getv(<<"query_params">>, PostProps, {[]}),
+ {Query} = couch_util:get_value(<<"query_params">>, PostProps, {[]}),
{ok, Info} = couch_db:get_db_info(Db),
% simulate a request to db_name/_changes
{[
@@ -307,7 +307,7 @@ handle_messages([Chunk|Rest], State) ->
#state{reply_to=nil} ->
State#state{
count = Count+1,
- last_seq = ?getv(<<"seq">>, Props),
+ last_seq = couch_util:get_value(<<"seq">>, Props),
partial_chunk = <<>>,
rows=queue:in(Row,Rows)
};
@@ -354,16 +354,16 @@ by_seq_loop(Server, Source, StartSeq) ->
qs = [{limit, 1000}, {startkey, StartSeq}]
},
{Results} = couch_rep_httpc:request(Req),
- Rows = ?getv(<<"rows">>, Results),
+ Rows = couch_util:get_value(<<"rows">>, Results),
if Rows =:= [] -> exit(normal); true -> ok end,
EndSeq = lists:foldl(fun({RowInfoList}, _) ->
- Id = ?getv(<<"id">>, RowInfoList),
- Seq = ?getv(<<"key">>, RowInfoList),
- {RowProps} = ?getv(<<"value">>, RowInfoList),
+ Id = couch_util:get_value(<<"id">>, RowInfoList),
+ Seq = couch_util:get_value(<<"key">>, RowInfoList),
+ {RowProps} = couch_util:get_value(<<"value">>, RowInfoList),
RawRevs = [
- ?getv(<<"rev">>, RowProps),
- ?getv(<<"conflicts">>, RowProps, []),
- ?getv(<<"deleted_conflicts">>, RowProps, [])
+ couch_util:get_value(<<"rev">>, RowProps),
+ couch_util:get_value(<<"conflicts">>, RowProps, []),
+ couch_util:get_value(<<"deleted_conflicts">>, RowProps, [])
],
ParsedRevs = couch_doc:parse_revs(lists:flatten(RawRevs)),
Change = {[