You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by kx...@apache.org on 2015/02/03 17:10:29 UTC

[1/2] fabric commit: updated refs/heads/master to adaf5c2

Repository: couchdb-fabric
Updated Branches:
  refs/heads/master f418f0df6 -> adaf5c231


Respect conflicts=true when collecting clustered changes

This correctly reads the conflicts parameter from #changes_args.
Previously we were attempting to look for a conflicts property in
Options which was never set (so always evaluated to false).

Fixes COUCHDB-2518

This closes #11

Signed-off-by: Alexander Shorin <kx...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/eb0f5cb3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/eb0f5cb3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/eb0f5cb3

Branch: refs/heads/master
Commit: eb0f5cb370c1ad64155e20a5b762380c3f25ac8d
Parents: f418f0d
Author: Will Holley <wi...@gmail.com>
Authored: Sun Feb 1 21:34:05 2015 +0000
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Feb 3 19:04:32 2015 +0300

----------------------------------------------------------------------
 src/fabric_rpc.erl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/eb0f5cb3/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl
index 6ee11b0..4a7881a 100644
--- a/src/fabric_rpc.erl
+++ b/src/fabric_rpc.erl
@@ -298,12 +298,14 @@ changes_enumerator(#doc_info{id= <<"_local/", _/binary>>, high_seq=Seq}, Acc) ->
 changes_enumerator(DocInfo, Acc) ->
     #cacc{
         db = Db,
-        args = #changes_args{include_docs = IncludeDocs, filter_fun = Filter},
-        options = Options,
+        args = #changes_args{
+            include_docs = IncludeDocs,
+            conflicts = Conflicts,
+            filter_fun = Filter
+        },
         pending = Pending,
         epochs = Epochs
     } = Acc,
-    Conflicts = proplists:get_value(conflicts, Options, false),
     #doc_info{id=Id, high_seq=Seq, revs=[#rev_info{deleted=Del}|_]} = DocInfo,
     case [X || X <- couch_changes:filter(Db, DocInfo, Filter), X /= null] of
     [] ->


[2/2] fabric commit: updated refs/heads/master to adaf5c2

Posted by kx...@apache.org.
Respect doc_options during _changes serialization

When including full documents in the changes feed response, respect
doc_options (e.g. attachments=true) during JSON serialization.

This closes #12

COUCHDB-2522

Signed-off-by: Alexander Shorin <kx...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/adaf5c23
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/adaf5c23
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/adaf5c23

Branch: refs/heads/master
Commit: adaf5c231537e0b34f456a2c91f54297223c753f
Parents: eb0f5cb
Author: Will Holley <wi...@gmail.com>
Authored: Mon Feb 2 21:02:27 2015 +0000
Committer: Alexander Shorin <kx...@apache.org>
Committed: Tue Feb 3 19:09:25 2015 +0300

----------------------------------------------------------------------
 src/fabric_rpc.erl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/adaf5c23/src/fabric_rpc.erl
----------------------------------------------------------------------
diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl
index 4a7881a..eeaebd1 100644
--- a/src/fabric_rpc.erl
+++ b/src/fabric_rpc.erl
@@ -301,7 +301,8 @@ changes_enumerator(DocInfo, Acc) ->
         args = #changes_args{
             include_docs = IncludeDocs,
             conflicts = Conflicts,
-            filter_fun = Filter
+            filter_fun = Filter,
+            doc_options = DocOptions
         },
         pending = Pending,
         epochs = Epochs
@@ -311,7 +312,7 @@ changes_enumerator(DocInfo, Acc) ->
     [] ->
         {ok, Acc#cacc{seq = Seq, pending = Pending-1}};
     Results ->
-        Opts = if Conflicts -> [conflicts]; true -> [] end,
+        Opts = if Conflicts -> [conflicts | DocOptions]; true -> DocOptions end,
         ChangesRow = {change, [
 	    {pending, Pending-1},
             {seq, {Seq, uuid(Db), owner_of(Seq, Epochs)}},
@@ -327,7 +328,7 @@ changes_enumerator(DocInfo, Acc) ->
 doc_member(Shard, DocInfo, Opts) ->
     case couch_db:open_doc(Shard, DocInfo, [deleted | Opts]) of
     {ok, Doc} ->
-        {doc, couch_doc:to_json_obj(Doc, [])};
+        {doc, couch_doc:to_json_obj(Doc, Opts)};
     Error ->
         Error
     end.