couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1037442 - in /couchdb/trunk: share/www/script/couch.js share/www/script/test/copy_doc.js src/couchdb/couch_httpd_db.erl
Date Sun, 21 Nov 2010 13:23:45 GMT
Author: jan
Date: Sun Nov 21 13:23:45 2010
New Revision: 1037442

URL: http://svn.apache.org/viewvc?rev=1037442&view=rev
Log:
Add ok:true to HTTP COPY response.

Patch by Robert Dionne.

Closes COUCHDB-903.

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

Modified: couchdb/trunk/share/www/script/couch.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch.js?rev=1037442&r1=1037441&r2=1037442&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/couch.js [utf-8] (original)
+++ couchdb/trunk/share/www/script/couch.js [utf-8] Sun Nov 21 13:23:45 2010
@@ -121,7 +121,7 @@ function CouchDB(name, httpHeaders) {
       CouchDB.maybeThrowError(this.last_req);
       var results = JSON.parse(this.last_req.responseText);
       for (var i = 0; i < docs.length; i++) {
-        if(results[i] && results[i].rev) {
+        if(results[i] && results[i].rev && results[i].ok) {
           docs[i]._rev = results[i].rev;
         }
       }

Modified: couchdb/trunk/share/www/script/test/copy_doc.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/copy_doc.js?rev=1037442&r1=1037441&r2=1037442&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/copy_doc.js (original)
+++ couchdb/trunk/share/www/script/test/copy_doc.js Sun Nov 21 13:23:45 2010
@@ -22,6 +22,8 @@ couchTests.copy_doc = function(debug) {
     headers: {"Destination":"doc_that_was_copied"}
   });
 
+    T(JSON.parse(xhr.responseText).ok);
+
   T(xhr.status == 201);
   T(db.open("doc_that_was_copied").v == 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=1037442&r1=1037441&r2=1037442&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_httpd_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_httpd_db.erl Sun Nov 21 13:23:45 2010
@@ -811,7 +811,7 @@ update_doc_result_to_json({{Id, Rev}, Er
 update_doc_result_to_json(#doc{id=DocId}, Result) ->
     update_doc_result_to_json(DocId, Result);
 update_doc_result_to_json(DocId, {ok, NewRev}) ->
-    {[{id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}]};
+    {[{ok, true}, {id, DocId}, {rev, couch_doc:rev_to_str(NewRev)}]};
 update_doc_result_to_json(DocId, Error) ->
     {_Code, ErrorStr, Reason} = couch_httpd:error_info(Error),
     {[{id, DocId}, {error, ErrorStr}, {reason, Reason}]}.



Mime
View raw message