Commit 46953d02 authored by Tristan Cavelier's avatar Tristan Cavelier

revisionstorage.js console.log removed

parent d7fcbbaf
...@@ -235,7 +235,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -235,7 +235,6 @@ jIO.addStorageType("revision", function (spec, my) {
delete doc._revs_info; delete doc._revs_info;
string = JSON.stringify(doc) + JSON.stringify(revision_history) + string = JSON.stringify(doc) + JSON.stringify(revision_history) +
JSON.stringify(deleted_flag ? true : false); JSON.stringify(deleted_flag ? true : false);
console.log(string);
revision_history.start += 1; revision_history.start += 1;
revision_history.ids.unshift(priv.hashCode(string)); revision_history.ids.unshift(priv.hashCode(string));
doc._revs = revision_history; doc._revs = revision_history;
...@@ -362,7 +361,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -362,7 +361,6 @@ jIO.addStorageType("revision", function (spec, my) {
priv.send("get", doc, option, callback); priv.send("get", doc, option, callback);
}; };
priv.put = function (doc, option, callback) { priv.put = function (doc, option, callback) {
console.log(doc);
priv.send("put", doc, option, callback); priv.send("put", doc, option, callback);
}; };
priv.remove = function (doc, option, callback) { priv.remove = function (doc, option, callback) {
...@@ -401,7 +399,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -401,7 +399,6 @@ jIO.addStorageType("revision", function (spec, my) {
}; };
priv.getAttachmentList = function (doc, option, callback) { priv.getAttachmentList = function (doc, option, callback) {
console.log("p getAttachmentList");
var attachment_id, dealResults, state = "ok", result_list = [], count = 0; var attachment_id, dealResults, state = "ok", result_list = [], count = 0;
dealResults = function (attachment_id, attachment_meta) { dealResults = function (attachment_id, attachment_meta) {
return function (err, attachment) { return function (err, attachment) {
...@@ -444,7 +441,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -444,7 +441,6 @@ jIO.addStorageType("revision", function (spec, my) {
}; };
priv.putAttachmentList = function (doc, option, attachment_list, callback) { priv.putAttachmentList = function (doc, option, attachment_list, callback) {
console.log("p putAttachmentList");
var i, dealResults, state = "ok", count = 0, attachment; var i, dealResults, state = "ok", count = 0, attachment;
attachment_list = attachment_list || []; attachment_list = attachment_list || [];
dealResults = function (index) { dealResults = function (index) {
...@@ -514,7 +510,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -514,7 +510,6 @@ jIO.addStorageType("revision", function (spec, my) {
doc._attachment = specific_parameter.attachment_id; doc._attachment = specific_parameter.attachment_id;
} }
callback.begin = function () { callback.begin = function () {
console.log("c begin");
var check_error; var check_error;
doc._id = doc._id || priv.generateUuid(); doc._id = doc._id || priv.generateUuid();
if (specific_parameter.revision_needed && !doc._rev) { if (specific_parameter.revision_needed && !doc._rev) {
...@@ -531,7 +526,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -531,7 +526,6 @@ jIO.addStorageType("revision", function (spec, my) {
priv.getRevisionTree(doc, option, callback.getRevisionTree); priv.getRevisionTree(doc, option, callback.getRevisionTree);
}; };
callback.getRevisionTree = function (err, response) { callback.getRevisionTree = function (err, response) {
console.log("c getRevisionTree");
var winner_info, previous_revision = doc._rev, var winner_info, previous_revision = doc._rev,
generate_new_revision = doc._revs || doc._revs_info ? false : true; generate_new_revision = doc._revs || doc._revs_info ? false : true;
if (err) { if (err) {
...@@ -543,9 +537,7 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -543,9 +537,7 @@ jIO.addStorageType("revision", function (spec, my) {
doc_tree = response || priv.newDocTree(); doc_tree = response || priv.newDocTree();
if (specific_parameter.get || specific_parameter.getAttachment) { if (specific_parameter.get || specific_parameter.getAttachment) {
if (!doc._rev) { if (!doc._rev) {
console.log(JSON.stringify(doc_tree));
winner_info = priv.getWinnerRevsInfo(doc_tree); winner_info = priv.getWinnerRevsInfo(doc_tree);
console.log(winner_info);
if (winner_info.length === 0) { if (winner_info.length === 0) {
return onEnd(priv.notFoundError( return onEnd(priv.notFoundError(
"Document not found", "Document not found",
...@@ -594,7 +586,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -594,7 +586,6 @@ jIO.addStorageType("revision", function (spec, my) {
return priv.getDocument(prev_doc, option, callback.getDocument); return priv.getDocument(prev_doc, option, callback.getDocument);
} }
if (specific_parameter.remove || specific_parameter.removeAttachment) { if (specific_parameter.remove || specific_parameter.removeAttachment) {
console.log("this one");
return onEnd(priv.notFoundError( return onEnd(priv.notFoundError(
"Unable to remove an inexistent document", "Unable to remove an inexistent document",
"missing" "missing"
...@@ -603,7 +594,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -603,7 +594,6 @@ jIO.addStorageType("revision", function (spec, my) {
priv.putDocument(doc, option, callback.putDocument); priv.putDocument(doc, option, callback.putDocument);
}; };
callback.getDocument = function (err, res_doc) { callback.getDocument = function (err, res_doc) {
console.log("c getDocument");
var k, conflicts; var k, conflicts;
if (err) { if (err) {
if (err.status === 404) { if (err.status === 404) {
...@@ -654,13 +644,10 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -654,13 +644,10 @@ jIO.addStorageType("revision", function (spec, my) {
if (specific_parameter.remove) { if (specific_parameter.remove) {
priv.putDocumentTree(doc, option, doc_tree, callback.putDocumentTree); priv.putDocumentTree(doc, option, doc_tree, callback.putDocumentTree);
} else { } else {
console.log("res_doc");
console.log(res_doc);
priv.getAttachmentList(res_doc, option, callback.getAttachmentList); priv.getAttachmentList(res_doc, option, callback.getAttachmentList);
} }
}; };
callback.getAttachmentList = function (err, res_list) { callback.getAttachmentList = function (err, res_list) {
console.log("c getAttachmentList");
var i, attachment_found = false; var i, attachment_found = false;
if (err) { if (err) {
err.message = "Cannot get attachment"; err.message = "Cannot get attachment";
...@@ -702,7 +689,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -702,7 +689,6 @@ jIO.addStorageType("revision", function (spec, my) {
priv.putDocument(doc, option, callback.putDocument); priv.putDocument(doc, option, callback.putDocument);
}; };
callback.putDocument = function (err, response) { callback.putDocument = function (err, response) {
console.log("c putDocument");
var i, attachment_found = false; var i, attachment_found = false;
if (err) { if (err) {
err.message = "Cannot post the document"; err.message = "Cannot post the document";
...@@ -731,7 +717,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -731,7 +717,6 @@ jIO.addStorageType("revision", function (spec, my) {
); );
}; };
callback.putAttachmentList = function (err, response) { callback.putAttachmentList = function (err, response) {
console.log("c putAttachmentList");
if (err) { if (err) {
err.message = "Cannot copy attacments to the document"; err.message = "Cannot copy attacments to the document";
return onEnd(err, undefined); return onEnd(err, undefined);
...@@ -739,7 +724,6 @@ jIO.addStorageType("revision", function (spec, my) { ...@@ -739,7 +724,6 @@ jIO.addStorageType("revision", function (spec, my) {
priv.putDocumentTree(doc, option, doc_tree, callback.putDocumentTree); priv.putDocumentTree(doc, option, doc_tree, callback.putDocumentTree);
}; };
callback.putDocumentTree = function (err, response) { callback.putDocumentTree = function (err, response) {
console.log("c putDocumentTree");
if (err) { if (err) {
err.message = "Cannot update the document history"; err.message = "Cannot update the document history";
return onEnd(err, undefined); return onEnd(err, undefined);
......
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