Permalink
Browse files

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
  • Loading branch information...
1 parent e70411d commit 7760859ce751b2a731c64e900ebcfa1a1b18fce4 Bob Dionne committed Aug 7, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 apps/couch/src/couch_httpd_db.erl
@@ -1216,6 +1216,9 @@ parse_doc_query(Req) ->
{"open_revs", RevsJsonStr} ->
JsonArray = ?JSON_DECODE(RevsJsonStr),
Args#doc_query_args{open_revs=couch_doc:parse_revs(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)};

0 comments on commit 7760859

Please sign in to comment.