From b5e95efc05a6b43bc03910b91b39ce72f69f94a3 Mon Sep 17 00:00:00 2001 From: Bob Dionne Date: Tue, 7 Aug 2012 13:33:23 -0400 Subject: [PATCH] Expose latest=true option in calls to retrieve revisions When a call is made to retrieve a specific revision, latest=true will retrieve any descendent leaves instead. This enables the replicator to better keep up with edits that occur whilst it's retrieving revisions BugzID: 14241 --- src/chttpd_db.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl index 895d5d4..38b0782 100644 --- a/src/chttpd_db.erl +++ b/src/chttpd_db.erl @@ -1148,6 +1148,9 @@ parse_doc_query(Req) -> {"open_revs", RevsJsonStr} -> JsonArray = ?JSON_DECODE(RevsJsonStr), Args#doc_query_args{open_revs=[couch_doc:parse_rev(Rev) || Rev <- JsonArray]}; + {"latest", "true"} -> + Options = [latest | Args#doc_query_args.options], + Args#doc_query_args{options=Options}; {"atts_since", RevsJsonStr} -> JsonArray = ?JSON_DECODE(RevsJsonStr), Args#doc_query_args{atts_since = couch_doc:parse_revs(JsonArray)};