From 0e7842b7b9fcece83c2657ab30eb30d99ba3241b Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 25 Apr 2012 15:40:29 +0200 Subject: [PATCH 1/3] fixed typo --- BasicsC/errors.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BasicsC/errors.dat b/BasicsC/errors.dat index 8339af7d17..fed1e1d8c1 100644 --- a/BasicsC/errors.dat +++ b/BasicsC/errors.dat @@ -57,9 +57,9 @@ ERROR_AVOCADO_CORRUPTED_COLLECTION,1102,"corrupted collection","Will be raised w ERROR_AVOCADO_MMAP_FAILED,1103,"mmap failed","Will be raised when the system call mmap failed." ERROR_AVOCADO_FILESYSTEM_FULL,1104,"filesystem full","Will be raised when the filesystem is full." ERROR_AVOCADO_NO_JOURNAL,1105,"no journal","Will be raised when a journal cannot be created." -ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS,1106,"cannot create/rename datafile because it ready exists","Will be raised when the datafile cannot be created or renamed because a file of the same name already exists." +ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS,1106,"cannot create/rename datafile because it already exists","Will be raised when the datafile cannot be created or renamed because a file of the same name already exists." ERROR_AVOCADO_DATABASE_LOCKED,1107,"database is locked","Will be raised when the database is locked by a different process." -ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS,1108,"cannot create/rename collection because directory ready exists","Will be raised when the collection cannot be created because a directory of the same name already exists." +ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS,1108,"cannot create/rename collection because directory already exists","Will be raised when the collection cannot be created because a directory of the same name already exists." ################################################################################ ## AvocadoDB storage errors From 68c24938db7ee729cc1008509c32b950a38ccce8 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 25 Apr 2012 16:19:02 +0200 Subject: [PATCH 2/3] fixed typo --- BasicsC/voc-errors.c | 4 ++-- BasicsC/voc-errors.h | 8 ++++---- js/common/bootstrap/errors.js | 4 ++-- js/common/bootstrap/js-errors.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BasicsC/voc-errors.c b/BasicsC/voc-errors.c index 93f941b9f7..5e0f3c43a1 100644 --- a/BasicsC/voc-errors.c +++ b/BasicsC/voc-errors.c @@ -42,9 +42,9 @@ void TRI_InitialiseErrorMessages (void) { REG_ERROR(ERROR_AVOCADO_MMAP_FAILED, "mmap failed"); REG_ERROR(ERROR_AVOCADO_FILESYSTEM_FULL, "filesystem full"); REG_ERROR(ERROR_AVOCADO_NO_JOURNAL, "no journal"); - REG_ERROR(ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS, "cannot create/rename datafile because it ready exists"); + REG_ERROR(ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS, "cannot create/rename datafile because it already exists"); REG_ERROR(ERROR_AVOCADO_DATABASE_LOCKED, "database is locked"); - REG_ERROR(ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS, "cannot create/rename collection because directory ready exists"); + REG_ERROR(ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS, "cannot create/rename collection because directory already exists"); REG_ERROR(ERROR_AVOCADO_CONFLICT, "conflict"); REG_ERROR(ERROR_AVOCADO_WRONG_VOCBASE_PATH, "wrong path for database"); REG_ERROR(ERROR_AVOCADO_DOCUMENT_NOT_FOUND, "document not found"); diff --git a/BasicsC/voc-errors.h b/BasicsC/voc-errors.h index 4a94e5881c..268bcfec88 100644 --- a/BasicsC/voc-errors.h +++ b/BasicsC/voc-errors.h @@ -77,12 +77,12 @@ extern "C" { /// Will be raised when the filesystem is full. /// - 1105: @CODE{no journal} /// Will be raised when a journal cannot be created. -/// - 1106: @CODE{cannot create/rename datafile because it ready exists} +/// - 1106: @CODE{cannot create/rename datafile because it already exists} /// Will be raised when the datafile cannot be created or renamed because a /// file of the same name already exists. /// - 1107: @CODE{database is locked} /// Will be raised when the database is locked by a different process. -/// - 1108: @CODE{cannot create/rename collection because directory ready exists} +/// - 1108: @CODE{cannot create/rename collection because directory already exists} /// Will be raised when the collection cannot be created because a directory /// of the same name already exists. /// - 1200: @CODE{conflict} @@ -597,7 +597,7 @@ void TRI_InitialiseErrorMessages (void); //////////////////////////////////////////////////////////////////////////////// /// @brief 1106: ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS /// -/// cannot create/rename datafile because it ready exists +/// cannot create/rename datafile because it already exists /// /// Will be raised when the datafile cannot be created or renamed because a /// file of the same name already exists. @@ -618,7 +618,7 @@ void TRI_InitialiseErrorMessages (void); //////////////////////////////////////////////////////////////////////////////// /// @brief 1108: ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS /// -/// cannot create/rename collection because directory ready exists +/// cannot create/rename collection because directory already exists /// /// Will be raised when the collection cannot be created because a directory of /// the same name already exists. diff --git a/js/common/bootstrap/errors.js b/js/common/bootstrap/errors.js index 4b41243926..33acb84c8d 100644 --- a/js/common/bootstrap/errors.js +++ b/js/common/bootstrap/errors.js @@ -36,9 +36,9 @@ ModuleCache["/internal"].exports.errors = { "ERROR_AVOCADO_MMAP_FAILED" : { "code" : 1103, "message" : "mmap failed" }, "ERROR_AVOCADO_FILESYSTEM_FULL" : { "code" : 1104, "message" : "filesystem full" }, "ERROR_AVOCADO_NO_JOURNAL" : { "code" : 1105, "message" : "no journal" }, - "ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS" : { "code" : 1106, "message" : "cannot create/rename datafile because it ready exists" }, + "ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS" : { "code" : 1106, "message" : "cannot create/rename datafile because it already exists" }, "ERROR_AVOCADO_DATABASE_LOCKED" : { "code" : 1107, "message" : "database is locked" }, - "ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS" : { "code" : 1108, "message" : "cannot create/rename collection because directory ready exists" }, + "ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS" : { "code" : 1108, "message" : "cannot create/rename collection because directory already exists" }, "ERROR_AVOCADO_CONFLICT" : { "code" : 1200, "message" : "conflict" }, "ERROR_AVOCADO_WRONG_VOCBASE_PATH" : { "code" : 1201, "message" : "wrong path for database" }, "ERROR_AVOCADO_DOCUMENT_NOT_FOUND" : { "code" : 1202, "message" : "document not found" }, diff --git a/js/common/bootstrap/js-errors.h b/js/common/bootstrap/js-errors.h index 58f84e13ee..b515c4aefc 100644 --- a/js/common/bootstrap/js-errors.h +++ b/js/common/bootstrap/js-errors.h @@ -37,9 +37,9 @@ static string JS_common_bootstrap_errors = " \"ERROR_AVOCADO_MMAP_FAILED\" : { \"code\" : 1103, \"message\" : \"mmap failed\" }, \n" " \"ERROR_AVOCADO_FILESYSTEM_FULL\" : { \"code\" : 1104, \"message\" : \"filesystem full\" }, \n" " \"ERROR_AVOCADO_NO_JOURNAL\" : { \"code\" : 1105, \"message\" : \"no journal\" }, \n" - " \"ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it ready exists\" }, \n" + " \"ERROR_AVOCADO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it already exists\" }, \n" " \"ERROR_AVOCADO_DATABASE_LOCKED\" : { \"code\" : 1107, \"message\" : \"database is locked\" }, \n" - " \"ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory ready exists\" }, \n" + " \"ERROR_AVOCADO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory already exists\" }, \n" " \"ERROR_AVOCADO_CONFLICT\" : { \"code\" : 1200, \"message\" : \"conflict\" }, \n" " \"ERROR_AVOCADO_WRONG_VOCBASE_PATH\" : { \"code\" : 1201, \"message\" : \"wrong path for database\" }, \n" " \"ERROR_AVOCADO_DOCUMENT_NOT_FOUND\" : { \"code\" : 1202, \"message\" : \"document not found\" }, \n" From 786dedc85e4c8f4672c7babd719abcc5ccb6905c Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Wed, 25 Apr 2012 16:24:17 +0200 Subject: [PATCH 3/3] fixed formatting mistakes --- js/common/modules/graph.js | 57 +++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/js/common/modules/graph.js b/js/common/modules/graph.js index d1597bf63f..d26f0dc792 100644 --- a/js/common/modules/graph.js +++ b/js/common/modules/graph.js @@ -98,7 +98,8 @@ findOrCreateCollectionByName = function (name) { if (col === null) { col = internal.db._create(name); - } else if (!(col instanceof AvocadoCollection)) { + } + else if (!(col instanceof AvocadoCollection)) { throw "<" + name + "> must be a document collection"; } @@ -118,7 +119,8 @@ findOrCreateEdgeCollectionByName = function (name) { if (col === null) { col = internal.edges._create(name); - } else if (!(col instanceof AvocadoEdgesCollection)) { + } + else if (!(col instanceof AvocadoEdgesCollection)) { throw "<" + name + "> must be a document collection"; } @@ -162,7 +164,8 @@ function Edge(graph, id) { if (props) { // extract the custom identifier, label, edges this._properties = props; - } else { + } + else { // deleted throw "accessing a deleted edge"; } @@ -354,13 +357,16 @@ Edge.prototype._PRINT = function (seen, path, names) { if (!this._id) { internal.output("[deleted Edge]"); - } else if (this._properties.$id !== undefined) { + } + else if (this._properties.$id !== undefined) { if (typeof this._properties.$id === "string") { internal.output("Edge(\"", this._properties.$id, "\")"); - } else { + } + else { internal.output("Edge(", this._properties.$id, ")"); } - } else { + } + else { internal.output("Edge(<", this._id, ">)"); } }; @@ -397,7 +403,8 @@ function Vertex(graph, id) { if (props) { // extract the custom identifier this._properties = props; - } else { + } + else { // deleted throw "accessing a deleted edge"; } @@ -544,7 +551,8 @@ Vertex.prototype.getInEdges = function () { if (arguments.length === 0) { result = this.inbound(); - } else { + } + else { labels = {}; for (i = 0; i < arguments.length; ++i) { @@ -583,7 +591,8 @@ Vertex.prototype.getOutEdges = function () { if (arguments.length === 0) { result = this.outbound(); - } else { + } + else { labels = {}; for (i = 0; i < arguments.length; ++i) { labels[arguments[i]] = true; @@ -766,13 +775,16 @@ Vertex.prototype._PRINT = function (seen, path, names) { if (!this._id) { internal.output("[deleted Vertex]"); - } else if (this._properties.$id !== undefined) { + } + else if (this._properties.$id !== undefined) { if (typeof this._properties.$id === "string") { internal.output("Vertex(\"", this._properties.$id, "\")"); - } else { + } + else { internal.output("Vertex(", this._properties.$id, ")"); } - } else { + } + else { internal.output("Vertex(<", this._id, ">)"); } }; @@ -862,11 +874,14 @@ function Graph(name, vertices, edges) { if (edges === null) { throw "edge collection '" + graphProperties.edges + "' has vanished"; } - } else if (typeof vertices !== "string" || vertices === "") { + } + else if (typeof vertices !== "string" || vertices === "") { throw " must be a string or null"; - } else if (typeof edges !== "string" || edges === "") { + } + else if (typeof edges !== "string" || edges === "") { throw " must be a string or null"; - } else { + } + else { // Create a new graph or get an existing graph vertices = findOrCreateCollectionByName(vertices); edges = findOrCreateEdgeCollectionByName(edges); @@ -895,10 +910,12 @@ function Graph(name, vertices, edges) { 'name' : name }); graphProperties = gdb.document(graphPropertiesId); - } else { + } + else { throw "found graph but has different "; } - } else { + } + else { if (graphProperties.vertices !== vertices._id) { throw "found graph but has different "; } @@ -1074,7 +1091,8 @@ Graph.prototype.getVertex = function (id) { if (ref !== null) { vertex = this.constructVertex(ref._id); - } else { + } + else { vertex = null; } @@ -1321,6 +1339,5 @@ exports.Vertex = Vertex; // Local Variables: // mode: outline-minor -// outline-regexp: -// "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)" +// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)" // End: