Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 54957 invoked from network); 25 Jun 2010 14:15:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Jun 2010 14:15:36 -0000 Received: (qmail 61373 invoked by uid 500); 25 Jun 2010 14:15:36 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 61327 invoked by uid 500); 25 Jun 2010 14:15:35 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 61320 invoked by uid 99); 25 Jun 2010 14:15:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 14:15:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Jun 2010 14:15:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BAD6B2388AA9; Fri, 25 Jun 2010 14:14:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r957963 - in /couchdb/branches/0.11.x: THANKS share/www/script/test/update_documents.js src/couchdb/couch_httpd_external.erl Date: Fri, 25 Jun 2010 14:14:39 -0000 To: commits@couchdb.apache.org From: jan@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100625141439.BAD6B2388AA9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jan Date: Fri Jun 25 14:14:39 2010 New Revision: 957963 URL: http://svn.apache.org/viewvc?rev=957963&view=rev Log: Merge r955389 from trunk: provide a uuid to update functions (and all other functions) that they can use to create new docs. closes COUCHDB-802. Thanks Jason Smith, Zachary Zolton, and Dmitry Unkovsky. Modified: couchdb/branches/0.11.x/THANKS couchdb/branches/0.11.x/share/www/script/test/update_documents.js couchdb/branches/0.11.x/src/couchdb/couch_httpd_external.erl Modified: couchdb/branches/0.11.x/THANKS URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/THANKS?rev=957963&r1=957962&r2=957963&view=diff ============================================================================== --- couchdb/branches/0.11.x/THANKS (original) +++ couchdb/branches/0.11.x/THANKS Fri Jun 25 14:14:39 2010 @@ -55,5 +55,8 @@ suggesting improvements or submitting ch * Timothy Smith * Martin Haaß * Hans Ulrich Niedermann + * Jason Smith + * Dmitry Unkovsky + * Zachary Zolton For a list of authors see the `AUTHORS` file. Modified: couchdb/branches/0.11.x/share/www/script/test/update_documents.js URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/share/www/script/test/update_documents.js?rev=957963&r1=957962&r2=957963&view=diff ============================================================================== --- couchdb/branches/0.11.x/share/www/script/test/update_documents.js (original) +++ couchdb/branches/0.11.x/share/www/script/test/update_documents.js Fri Jun 25 14:14:39 2010 @@ -72,6 +72,9 @@ couchTests.update_documents = function(d }; return [doc, resp]; + }), + "get-uuid" : stringFun(function(doc, req) { + return [null, req.uuid]; }) } }; @@ -123,7 +126,7 @@ couchTests.update_documents = function(d // bump counter xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/bump-counter/"+docid, { - headers : {"X-Couch-Full-Commit":"false"} + headers : {"X-Couch-Full-Commit":"true"} }); T(xhr.status == 201); T(xhr.responseText == "

bumped it!

"); @@ -144,7 +147,7 @@ couchTests.update_documents = function(d // parse xml xhr = CouchDB.request("PUT", "/test_suite_db/_design/update/_update/xml/"+docid, { - headers : {"X-Couch-Full-Commit":"false"}, + headers : {"X-Couch-Full-Commit":"true"}, "body" : 'bar' }); T(xhr.status == 201); @@ -152,5 +155,10 @@ couchTests.update_documents = function(d doc = db.open(docid); T(doc.via_xml == "bar"); + + // Server provides UUID when POSTing without an ID in the URL + xhr = CouchDB.request("POST", "/test_suite_db/_design/update/_update/get-uuid/"); + T(xhr.status == 200); + T(xhr.responseText.length == 32); }; Modified: couchdb/branches/0.11.x/src/couchdb/couch_httpd_external.erl URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_httpd_external.erl?rev=957963&r1=957962&r2=957963&view=diff ============================================================================== --- couchdb/branches/0.11.x/src/couchdb/couch_httpd_external.erl (original) +++ couchdb/branches/0.11.x/src/couchdb/couch_httpd_external.erl Fri Jun 25 14:14:39 2010 @@ -75,6 +75,7 @@ json_req_obj(#httpd{mochi_req=Req, % add headers... {[{<<"info">>, {Info}}, {<<"id">>, DocId}, + {<<"uuid">>, couch_uuids:new()}, {<<"method">>, Method}, {<<"path">>, Path}, {<<"query">>, json_query_keys(to_json_terms(Req:parse_qs()))},