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 dc15027 commit 7967c2f7b71a03a5b8eb9f2c72e7b5959f8fc4eb Bob Dionne committed with Robert Newson Aug 7, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 apps/couch/src/couch_httpd_db.erl
View
3 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 7967c2f

Please sign in to comment.