Commit 081a3431 authored by Tristan Cavelier's avatar Tristan Cavelier

Cleaning some code

parent 450a8e3e
...@@ -215,8 +215,7 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -215,8 +215,7 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
priv.post_allowed = true; priv.post_allowed = true;
} }
doc_env = my.env[doc._id]; doc_env = my.env[doc._id];
if (doc_env && doc_env.id) { if (!doc_env || !doc_env.id) {
} else {
doc_env = priv.initEnv(doc._id); doc_env = priv.initEnv(doc._id);
} }
my_rev = priv.generateNextRevision(doc._rev || 0, doc._id); my_rev = priv.generateNextRevision(doc._rev || 0, doc._id);
...@@ -380,7 +379,9 @@ jIO.addStorageType('replicaterevision', function (spec, my) { ...@@ -380,7 +379,9 @@ jIO.addStorageType('replicaterevision', function (spec, my) {
tmp_object = {}; tmp_object = {};
start = response._revisions.start; start = response._revisions.start;
for (i = 0; i < response._revisions.ids.length; i += 1, start -= 1) { for (i = 0; i < response._revisions.ids.length; i += 1, start -= 1) {
tmp = doc_env.distant_revisions[start + "-" + response._revisions.ids[i]]; tmp = doc_env.distant_revisions[
start + "-" + response._revisions.ids[i]
];
if (tmp) { if (tmp) {
response._revisions.ids[i] = tmp.split("-").slice(1).join("-"); response._revisions.ids[i] = tmp.split("-").slice(1).join("-");
} }
......
...@@ -2161,7 +2161,6 @@ module ("JIO Replicate Revision Storage"); ...@@ -2161,7 +2161,6 @@ module ("JIO Replicate Revision Storage");
o.tick(o); o.tick(o);
// get the post document with specific revision // get the post document with specific revision
console.log(o.specific_rev);
o.spy(o, "value", { o.spy(o, "value", {
"_id": "doc1", "_id": "doc1",
"title": "post new doc with id", "title": "post new doc with id",
......
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