diff options
author | Randall Leeds <randall@apache.org> | 2011-11-09 10:58:57 -0800 |
---|---|---|
committer | Randall Leeds <randall@apache.org> | 2011-11-09 10:58:57 -0800 |
commit | 84940845230b7ce04cc0ffee2575e0541ab607c7 (patch) | |
tree | 24ea5fd4f65874fb84fb5fa0632910ee209957bb | |
parent | 68c0f5a705b5b367a5b59337158b66288671f1e6 (diff) | |
download | couchdb-84940845230b7ce04cc0ffee2575e0541ab607c7.tar.gz |
Revert "use couch_db calls instead of couch_btree"
We can't do this without other changes since couch_db:get_design_docs
is hard coded to skip deleted documents, and that's incompatible with
how _changes is supposed to behave.
This reverts commit e41d226dca11dc8b24d6c011cc3014e6c553db42.
-rw-r--r-- | src/couchdb/couch_changes.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/couchdb/couch_changes.erl b/src/couchdb/couch_changes.erl index 30f1d880e..267f3d793 100644 --- a/src/couchdb/couch_changes.erl +++ b/src/couchdb/couch_changes.erl @@ -298,7 +298,7 @@ send_changes(Args, Callback, UserAcc, Db, StartSeq, Prepend, FirstRound) -> send_changes_doc_ids(DocIds, Db, StartSeq, Dir, Fun, Acc0) -> - Lookups = couch_db:get_full_doc_infos(Db, DocIds), + Lookups = couch_btree:lookup(Db#db.fulldocinfo_by_id_btree, DocIds), FullDocInfos = lists:foldl( fun({ok, FDI}, Acc) -> [FDI | Acc]; @@ -310,7 +310,12 @@ send_changes_doc_ids(DocIds, Db, StartSeq, Dir, Fun, Acc0) -> send_changes_design_docs(Db, StartSeq, Dir, Fun, Acc0) -> - FullDocInfos = couch_db:get_design_docs(Db), + FoldFun = fun(FullDocInfo, _, Acc) -> + {ok, [FullDocInfo | Acc]} + end, + KeyOpts = [{start_key, <<"_design/">>}, {end_key_gt, <<"_design0">>}], + {ok, _, FullDocInfos} = couch_btree:fold( + Db#db.fulldocinfo_by_id_btree, FoldFun, [], KeyOpts), send_lookup_changes(FullDocInfos, StartSeq, Dir, Db, Fun, Acc0). |