You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2021/03/14 16:57:57 UTC
[couchdb] branch fix/3362/latest-conflicts updated (8f4fd9f ->
9d96a0e)
This is an automated email from the ASF dual-hosted git repository.
jan pushed a change to branch fix/3362/latest-conflicts
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
discard 8f4fd9f fix badmatch when fetching latest rev
new 9d96a0e fix badmatch when fetching latest rev
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (8f4fd9f)
\
N -- N -- N refs/heads/fix/3362/latest-conflicts (9d96a0e)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
[couchdb] 01/01: fix badmatch when fetching latest rev
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch fix/3362/latest-conflicts
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 9d96a0e8c559a9c865b24397e40a65936c77460c
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Sun Mar 14 17:56:41 2021 +0100
fix badmatch when fetching latest rev
Closes #3362
---
src/chttpd/src/chttpd_db.erl | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/chttpd/src/chttpd_db.erl b/src/chttpd/src/chttpd_db.erl
index 27a564b..e107e00 100644
--- a/src/chttpd/src/chttpd_db.erl
+++ b/src/chttpd/src/chttpd_db.erl
@@ -919,7 +919,7 @@ db_doc_req(#httpd{method='DELETE'}=Req, Db, DocId) ->
db_doc_req(#httpd{method='GET', mochi_req=MochiReq}=Req, Db, DocId) ->
#doc_query_args{
- rev = Rev,
+ rev = Rev0,
open_revs = Revs,
options = Options0,
atts_since = AttsSince
@@ -932,6 +932,12 @@ db_doc_req(#httpd{method='GET', mochi_req=MochiReq}=Req, Db, DocId) ->
[{atts_since, AttsSince}, attachments | Options];
true -> Options
end,
+ Rev = case lists:member(latest, Options) of
+ % couch_doc_open will open the winning rev despite of a rev passed
+ % https://docs.couchdb.org/en/stable/api/document/common.html?highlight=latest#get--db-docid
+ true -> nil;
+ false -> Rev0
+ end,
Doc = couch_doc_open(Db, DocId, Rev, Options2),
send_doc(Req, Doc, Options2);
_ ->