Commit 3bab0692 authored by Tristan Cavelier's avatar Tristan Cavelier

Revision storage -> getWinnerRevision didn't get the winner: Fixed

parent f2b7952a
...@@ -323,8 +323,11 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -323,8 +323,11 @@ jIO.addStorageType("revision", function (spec, my) {
tmp_revs_info.unshift({"rev": doc_tree.rev, "status": doc_tree.status}); tmp_revs_info.unshift({"rev": doc_tree.rev, "status": doc_tree.status});
} }
if (doc_tree.children.length === 0) { if (doc_tree.children.length === 0) {
if (revs_info.length < tmp_revs_info.length || if (revs_info.length === 0 ||
(revs_info.length > 0 && revs_info[0].status === "deleted")) { (revs_info[0].status !== "available" &&
tmp_revs_info[0].status === "available") ||
(tmp_revs_info[0].status === "available" &&
revs_info.length < tmp_revs_info.length)) {
revs_info = priv.clone(tmp_revs_info); revs_info = priv.clone(tmp_revs_info);
} }
} }
......
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