Commit ffd9504f authored by Tristan Cavelier's avatar Tristan Cavelier

revision storage jslint OK

parent 3bab0692
...@@ -923,7 +923,7 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -923,7 +923,7 @@ jIO.addStorageType("revision", function (spec, my) {
} }
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];
if (document_revision) { if (document_revision) {
row = { row = {
"id": doc_id, "id": doc_id,
...@@ -954,7 +954,7 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -954,7 +954,7 @@ jIO.addStorageType("revision", function (spec, my) {
if (err) { if (err) {
return that.error(err); return that.error(err);
} }
selector = /^(.*)\.revision_tree\.json$/; selector = /\.revision_tree\.json$/;
rows = { rows = {
"revision_trees": { "revision_trees": {
// id.revision_tree.json: { // id.revision_tree.json: {
...@@ -973,11 +973,12 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -973,11 +973,12 @@ jIO.addStorageType("revision", function (spec, my) {
while (response.rows.length > 0) { while (response.rows.length > 0) {
// filling rows // filling rows
row = response.rows.shift(); row = response.rows.shift();
selected = selector.exec(row.id) selected = selector.exec(row.id);
if (selected) { if (selected) {
selected = selected.input.substring(0, selected.index);
// this is a revision tree // this is a revision tree
rows.revision_trees[row.id] = { rows.revision_trees[row.id] = {
"id": selected[1] "id": selected
}; };
if (row.doc) { if (row.doc) {
rows.revision_trees[row.id].doc = row.doc; rows.revision_trees[row.id].doc = row.doc;
...@@ -985,7 +986,7 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -985,7 +986,7 @@ jIO.addStorageType("revision", function (spec, my) {
} else { } else {
// this is a simple revision // this is a simple revision
rows.document_revisions[row.id] = { rows.document_revisions[row.id] = {
"id": row.id.split(".").slice(0,-1), "id": row.id.split(".").slice(0, -1),
"rev": row.id.split(".").slice(-1) "rev": row.id.split(".").slice(-1)
}; };
if (row.doc) { if (row.doc) {
......
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