diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-09-30 12:03:15 +0000 |
commit | 6ae13b5f8b827bc87a8cf3306c3caa1b97e49df3 (patch) | |
tree | 9662164348a314705094f5f52456ab7bfe330df9 /src/couchdb/couch_rep_missing_revs.erl | |
parent | 1c0a6e9c637fcfec2990c6318b3c69e4c7591d76 (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_missing_revs.erl')
-rw-r--r-- | src/couchdb/couch_rep_missing_revs.erl | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/couchdb/couch_rep_missing_revs.erl b/src/couchdb/couch_rep_missing_revs.erl index 6e46c1ce..1eff6774 100644 --- a/src/couchdb/couch_rep_missing_revs.erl +++ b/src/couchdb/couch_rep_missing_revs.erl @@ -145,44 +145,44 @@ changes_loop(OurServer, SourceChangesServer, Target) -> get_missing_revs(#http_db{}=Target, Changes) -> Transform = fun({Props}) -> - C = ?getv(<<"changes">>, Props), - Id = ?getv(<<"id">>, Props), + C = couch_util:get_value(<<"changes">>, Props), + Id = couch_util:get_value(<<"id">>, Props), {Id, [R || {[{<<"rev">>, R}]} <- C]} end, IdRevsList = [Transform(Change) || Change <- Changes], SeqDict = changes_dictionary(Changes), {LastProps} = lists:last(Changes), - HighSeq = ?getv(<<"seq">>, LastProps), + HighSeq = couch_util:get_value(<<"seq">>, LastProps), Request = Target#http_db{ resource = "_missing_revs", method = post, body = {IdRevsList} }, {Resp} = couch_rep_httpc:request(Request), - case ?getv(<<"missing_revs">>, Resp) of + case couch_util:get_value(<<"missing_revs">>, Resp) of {MissingRevs} -> X = [{Id, dict:fetch(Id, SeqDict), couch_doc:parse_revs(RevStrs)} || {Id,RevStrs} <- MissingRevs], {HighSeq, X}; _ -> - exit({target_error, ?getv(<<"error">>, Resp)}) + exit({target_error, couch_util:get_value(<<"error">>, Resp)}) end; get_missing_revs(Target, Changes) -> Transform = fun({Props}) -> - C = ?getv(<<"changes">>, Props), - Id = ?getv(<<"id">>, Props), + C = couch_util:get_value(<<"changes">>, Props), + Id = couch_util:get_value(<<"id">>, Props), {Id, [couch_doc:parse_rev(R) || {[{<<"rev">>, R}]} <- C]} end, IdRevsList = [Transform(Change) || Change <- Changes], SeqDict = changes_dictionary(Changes), {LastProps} = lists:last(Changes), - HighSeq = ?getv(<<"seq">>, LastProps), + HighSeq = couch_util:get_value(<<"seq">>, LastProps), {ok, Results} = couch_db:get_missing_revs(Target, IdRevsList), {HighSeq, [{Id, dict:fetch(Id, SeqDict), Revs} || {Id, Revs, _} <- Results]}. changes_dictionary(ChangeList) -> - KVs = [{?getv(<<"id">>,C), ?getv(<<"seq">>,C)} + KVs = [{couch_util:get_value(<<"id">>,C), couch_util:get_value(<<"seq">>,C)} || {C} <- ChangeList], dict:from_list(KVs). |