couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r912606 - in /couchdb/trunk: share/www/script/test/purge.js src/couchdb/couch_db_updater.erl
Date Mon, 22 Feb 2010 15:18:46 GMT
Author: davisp
Date: Mon Feb 22 15:18:46 2010
New Revision: 912606

URL: http://svn.apache.org/viewvc?rev=912606&view=rev
Log:
_purge was incorrectly returning update_seq.

Patched and tested.


Modified:
    couchdb/trunk/share/www/script/test/purge.js
    couchdb/trunk/src/couchdb/couch_db_updater.erl

Modified: couchdb/trunk/share/www/script/test/purge.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/purge.js?rev=912606&r1=912605&r2=912606&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/purge.js (original)
+++ couchdb/trunk/share/www/script/test/purge.js Mon Feb 22 15:18:46 2010
@@ -54,13 +54,15 @@
   });
   T(xhr.status == 200);
 
+  var result = JSON.parse(xhr.responseText);
   var newInfo = db.info();
+  
   // purging increments the update sequence
   T(info.update_seq+1 == newInfo.update_seq);
   // and it increments the purge_seq
   T(info.purge_seq+1 == newInfo.purge_seq);
+  T(result.purge_seq == newInfo.purge_seq);
 
-  var result = JSON.parse(xhr.responseText);
   T(result.purged["1"][0] == doc1._rev);
   T(result.purged["2"][0] == doc2._rev);
 
@@ -91,6 +93,8 @@
   });
 
   T(xhr.status == 200);
+  result = JSON.parse(xhr.responseText);
+  T(result.purge_seq == db.info().purge_seq);
 
   var rows = db.view("test/all_docs_twice").rows;
   for (var i = 4; i < numDocs; i++) {

Modified: couchdb/trunk/src/couchdb/couch_db_updater.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db_updater.erl?rev=912606&r1=912605&r2=912606&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db_updater.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db_updater.erl Mon Feb 22 15:18:46 2010
@@ -130,7 +130,7 @@
 
     ok = gen_server:call(Db2#db.main_pid, {db_updated, Db2}),
     couch_db_update_notifier:notify({updated, Db#db.name}),
-    {reply, {ok, Db2#db.update_seq, IdRevsPurged}, Db2}.
+    {reply, {ok, (Db2#db.header)#db_header.purge_seq, IdRevsPurged}, Db2}.
 
 
 handle_cast(start_compact, Db) ->



Mime
View raw message