From 772fdde2eb970177438038a2479ec13385372cf5 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Wed, 9 Mar 2011 19:09:11 +0000 Subject: Merged revision 1079939 from trunk Parameter "include_docs" now honors parameter "conflicts" When querying a map view, /db/_all_docs/ or /db/_changes/ with "include_docs=true", if "conflicts=true" is given as well, the documents will contain the conflicts list (if there are conflicting revisions). Closes COUCHDB-549. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1079941 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/all_docs.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'share/www/script/test/all_docs.js') diff --git a/share/www/script/test/all_docs.js b/share/www/script/test/all_docs.js index 4324e3bb..1d83aa95 100644 --- a/share/www/script/test/all_docs.js +++ b/share/www/script/test/all_docs.js @@ -105,20 +105,24 @@ couchTests.all_docs = function(debug) { var winRev = db.open("3"); - changes = db.changes({include_docs: true, style: "all_docs"}); + changes = db.changes({include_docs: true, conflicts: true, style: "all_docs"}); TEquals("3", changes.results[3].id); TEquals(3, changes.results[3].changes.length); TEquals(winRev._rev, changes.results[3].changes[0].rev); TEquals("3", changes.results[3].doc._id); TEquals(winRev._rev, changes.results[3].doc._rev); + TEquals(true, changes.results[3].doc._conflicts instanceof Array); + TEquals(2, changes.results[3].doc._conflicts.length); - rows = db.allDocs({include_docs: true}).rows; + rows = db.allDocs({include_docs: true, conflicts: true}).rows; TEquals(3, rows.length); TEquals("3", rows[2].key); TEquals("3", rows[2].id); TEquals(winRev._rev, rows[2].value.rev); TEquals(winRev._rev, rows[2].doc._rev); TEquals("3", rows[2].doc._id); + TEquals(true, rows[2].doc._conflicts instanceof Array); + TEquals(2, rows[2].doc._conflicts.length); // test the all docs collates sanely db.save({_id: "Z", foo: "Z"}); -- cgit v1.2.3