Commit ef537ed4 authored by Tristan Cavelier's avatar Tristan Cavelier

revisionstorage.js bug fix to pass tests

parent c42de5ff
...@@ -948,6 +948,10 @@ ...@@ -948,6 +948,10 @@
if (err) { if (err) {
return command.error(err); return command.error(err);
} }
doc_tree = doc_tree.data;
if (typeof doc_tree.children === 'string') {
doc_tree.children = JSON.parse(doc_tree.children);
}
revs_info = priv.getWinnerRevsInfo(doc_tree); revs_info = priv.getWinnerRevsInfo(doc_tree);
document_revision = document_revision =
rows.document_revisions[doc_id + "." + revs_info[0].rev]; rows.document_revisions[doc_id + "." + revs_info[0].rev];
...@@ -973,7 +977,7 @@ ...@@ -973,7 +977,7 @@
functions.success = function () { functions.success = function () {
functions.finished -= 1; functions.finished -= 1;
if (functions.finished === 0) { if (functions.finished === 0) {
command.success(result); command.success({"data": result});
} }
}; };
priv.send(command, "allDocs", null, option, function (err, response) { priv.send(command, "allDocs", null, option, function (err, response) {
...@@ -1028,7 +1032,7 @@ ...@@ -1028,7 +1032,7 @@
functions.finished += 1; functions.finished += 1;
if (rows.revision_trees[i].doc) { if (rows.revision_trees[i].doc) {
functions.falseResponseGenerator( functions.falseResponseGenerator(
rows.revision_trees[i].doc, {"data": rows.revision_trees[i].doc},
functions.fillResultGenerator(rows.revision_trees[i].id) functions.fillResultGenerator(rows.revision_trees[i].id)
); );
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment