couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject svn commit: r808574 - in /couchdb/trunk: share/www/script/test/changes.js src/couchdb/couch_httpd_db.erl
Date Thu, 27 Aug 2009 19:26:36 GMT
Author: kocolosk
Date: Thu Aug 27 19:26:35 2009
New Revision: 808574

URL: http://svn.apache.org/viewvc?rev=808574&view=rev
Log:
send deleted docs to _changes filters

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

Modified: couchdb/trunk/share/www/script/test/changes.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/changes.js?rev=808574&r1=808573&r2=808574&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/changes.js (original)
+++ couchdb/trunk/share/www/script/test/changes.js Thu Aug 27 19:26:35 2009
@@ -189,6 +189,15 @@
   resp = JSON.parse(req.responseText);
   T(resp.results.length == 1);
   
+  // changes get all_docs style with deleted docs
+  var doc = {a:1};
+  db.save(doc);
+  db.deleteDoc(doc);
+  var req = CouchDB.request("GET", 
+    "/test_suite_db/_changes?filter=changes_filter/bop&style=all_docs");
+  var resp = JSON.parse(req.responseText);
+  TEquals(1, resp.results.length, "should return one result row");
+  
   // test for userCtx
   run_on_modified_server(
     [{section: "httpd",

Modified: couchdb/trunk/src/couchdb/couch_httpd_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd_db.erl?rev=808574&r1=808573&r2=808574&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Thu Aug 27 19:26:35 2009
@@ -194,7 +194,7 @@
         FilterSrc = couch_util:get_nested_json_value({Props}, [<<"filters">>,
FName]),
         {ok, Pid} = couch_query_servers:start_filter(Lang, FilterSrc),
         FilterFun = fun(DInfo = #doc_info{revs=[#rev_info{rev=Rev}|_]}) ->
-            {ok, Doc} = couch_db:open_doc(Db, DInfo),
+            {ok, Doc} = couch_db:open_doc(Db, DInfo, [deleted]),
             {ok, Pass} = couch_query_servers:filter_doc(Pid, Doc, Req, Db),
             case Pass of
             true ->



Mime
View raw message