Commit 246f00e1 authored by Tristan Cavelier's avatar Tristan Cavelier

Remove console.logs from revision storage

parent 42c5bf5d
...@@ -691,10 +691,8 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -691,10 +691,8 @@ jIO.addStorageType('revision', function (spec, my) {
function (response) { function (response) {
var attachment_list = [], i; var attachment_list = [], i;
prev_doc = response; prev_doc = response;
console.log(0);
for (i in response._attachments) { for (i in response._attachments) {
if (response._attachments.hasOwnProperty(i)) { if (response._attachments.hasOwnProperty(i)) {
console.log(2);
attachment_list.push({"id": i, "attachment": { attachment_list.push({"id": i, "attachment": {
"_id": command.getDocId() + "." + revs_info[0].rev + "/" + i, "_id": command.getDocId() + "." + revs_info[0].rev + "/" + i,
"_mimetype": response._attachments[i].content_type, "_mimetype": response._attachments[i].content_type,
...@@ -712,7 +710,6 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -712,7 +710,6 @@ jIO.addStorageType('revision', function (spec, my) {
} }
}; };
functions.postDocument = function (attachment_list) { functions.postDocument = function (attachment_list) {
console.log(3);
that.addJob( that.addJob(
"post", "post",
priv.substorage, priv.substorage,
...@@ -720,15 +717,11 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -720,15 +717,11 @@ jIO.addStorageType('revision', function (spec, my) {
command.getOption(), command.getOption(),
function (response) { function (response) {
var i; var i;
console.log(4);
if (attachment_list.length === 0) { if (attachment_list.length === 0) {
console.log(5);
functions.postAttachment(); functions.postAttachment();
} else { } else {
console.log(6);
functions.post_attachment_count = attachment_list.length; functions.post_attachment_count = attachment_list.length;
for (i = 0; i < attachment_list.length; i += 1) { for (i = 0; i < attachment_list.length; i += 1) {
console.log(7);
functions.copyAttachment(attachment_list[i].id, functions.copyAttachment(attachment_list[i].id,
attachment_list[i].attachment); attachment_list[i].attachment);
} }
...@@ -741,14 +734,12 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -741,14 +734,12 @@ jIO.addStorageType('revision', function (spec, my) {
); );
}; };
functions.copyAttachment = function (attachmentid, attachment) { functions.copyAttachment = function (attachmentid, attachment) {
console.log(8);
that.addJob( that.addJob(
"get", "get",
priv.substorage, priv.substorage,
prev_doc._id + "/" + attachmentid, prev_doc._id + "/" + attachmentid,
command.cloneOption(), command.cloneOption(),
function (response) { function (response) {
console.log(7);
attachment._data = response; attachment._data = response;
that.addJob( that.addJob(
"putAttachment", "putAttachment",
...@@ -756,18 +747,15 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -756,18 +747,15 @@ jIO.addStorageType('revision', function (spec, my) {
attachment, attachment,
command.cloneOption(), command.cloneOption(),
function (response) { function (response) {
console.log(9);
functions.postAttachment(); functions.postAttachment();
}, },
function (err) { function (err) {
console.log(10);
err.message = "Cannot copy previous attachment"; err.message = "Cannot copy previous attachment";
functions.error(err); functions.error(err);
} }
); );
}, },
function (err) { function (err) {
console.log(11);
err.message = "Cannot copy previous attachment"; err.message = "Cannot copy previous attachment";
functions.error(err); functions.error(err);
} }
......
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