Commit 9268d81a authored by Tristan Cavelier's avatar Tristan Cavelier

fix revisionstorage error, it was writing doc._rev in sub_storage

parent 4ae4e5be
...@@ -474,6 +474,7 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -474,6 +474,7 @@ jIO.addStorageType('revision', function (spec, my) {
f.postDocument = function (doctree_update_method) { f.postDocument = function (doctree_update_method) {
revs_info = priv.postToDocumentTree(doctree, doc); revs_info = priv.postToDocumentTree(doctree, doc);
doc._id = docid + "." + revs_info[0].rev; doc._id = docid + "." + revs_info[0].rev;
delete doc._rev;
that.addJob( that.addJob(
"post", "post",
priv.substorage, priv.substorage,
......
...@@ -1198,6 +1198,7 @@ test ("Post", function(){ ...@@ -1198,6 +1198,7 @@ test ("Post", function(){
// check document // check document
o.doc["_id"] = "post1."+o.rev; o.doc["_id"] = "post1."+o.rev;
delete o.doc._rev;
deepEqual( deepEqual(
localstorage.getItem(o.localpath + "/post1." + o.rev), localstorage.getItem(o.localpath + "/post1." + o.rev),
o.doc, o.doc,
...@@ -1289,6 +1290,7 @@ test ("Put", function(){ ...@@ -1289,6 +1290,7 @@ test ("Put", function(){
// check document // check document
o.doc._id = "put1." + o.rev; o.doc._id = "put1." + o.rev;
delete o.doc._rev;
deepEqual( deepEqual(
localstorage.getItem(o.localpath + "/put1." + o.rev), localstorage.getItem(o.localpath + "/put1." + o.rev),
o.doc, o.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