couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r902422 - in /couchdb/trunk: THANKS share/www/script/test/changes.js src/couchdb/couch_httpd_db.erl
Date Sat, 23 Jan 2010 15:29:33 GMT
Author: jan
Date: Sat Jan 23 15:29:33 2010
New Revision: 902422

URL: http://svn.apache.org/viewvc?rev=902422&view=rev
Log:
show conflicts in changes filters. Patch by Lena Herrmann. Closes COUCHDB-630

Modified:
    couchdb/trunk/THANKS
    couchdb/trunk/share/www/script/test/changes.js
    couchdb/trunk/src/couchdb/couch_httpd_db.erl

Modified: couchdb/trunk/THANKS
URL: http://svn.apache.org/viewvc/couchdb/trunk/THANKS?rev=902422&r1=902421&r2=902422&view=diff
==============================================================================
--- couchdb/trunk/THANKS (original)
+++ couchdb/trunk/THANKS Sat Jan 23 15:29:33 2010
@@ -42,5 +42,6 @@
  * Matthew Hooker <mwhooker@gmail.com>
  * Filipe Manana <fdmanana@gmail.com>
  * Ilia Cheishvili <ilia.cheishvili@gmail.com>
+ * Lena Herrmann <lena@zeromail.org>
 
 For a list of authors see the `AUTHORS` file.

Modified: couchdb/trunk/share/www/script/test/changes.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/changes.js?rev=902422&r1=902421&r2=902422&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/changes.js (original)
+++ couchdb/trunk/share/www/script/test/changes.js Sat Jan 23 15:29:33 2010
@@ -175,7 +175,8 @@
       }),
       "userCtx" : stringFun(function(doc, req) {
         return doc.user && (doc.user == req.userCtx.name);
-      })
+      }),
+      "conflicted" : "function(doc, req) { return (doc._conflicts);}",
     }
   }
 
@@ -286,11 +287,19 @@
       resp = JSON.parse(req.responseText);
       T(resp.results.length == 1, "userCtx");
       T(resp.results[0].id == docResp.id);
-    });
+    }
+  );
 
   req = CouchDB.request("GET", "/test_suite_db/_changes?limit=1");
   resp = JSON.parse(req.responseText);
-  TEquals(1, resp.results.length);
+  TEquals(1, resp.results.length)
 
+  //filter includes _conflicts
+  var id = db.save({'food' : 'pizza'}).id;
+  db.bulkSave([{_id: id, 'food' : 'pasta'}], {all_or_nothing:true});
 
+  req = CouchDB.request("GET", "/test_suite_db/_changes?filter=changes_filter/conflicted");
+  resp = JSON.parse(req.responseText);
+  T(resp.results.length == 1);
 };
+

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=902422&r1=902421&r2=902422&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Sat Jan 23 15:29:33 2010
@@ -237,7 +237,7 @@
         couch_util:get_nested_json_value({Props}, [<<"filters">>, FName]),
         fun(DocInfos) ->
             Docs = [Doc || {ok, Doc} <- [
-                {ok, Doc} = couch_db:open_doc(Db, DInfo, [deleted])
+                {ok, Doc} = couch_db:open_doc(Db, DInfo, [deleted, conflicts])
                 || DInfo <- DocInfos]],
             {ok, Passes} = couch_query_servers:filter_docs(Req, Db, DDoc, FName, Docs),
             [{[{rev, couch_doc:rev_to_str(Rev)}]}



Mime
View raw message