Skip to content
This repository
Browse code

Merge branch 'master' into fix_tests_revisions

Conflicts:
	plugins-server/cloud9.ide.revisions/revisions.js
  • Loading branch information...
commit 5afbc9e25b60b4ea7f59b5c6ffbf5a913d071eed 2 parents aeb61e4 + ba0ec76
Sergi Mansilla authored October 02, 2012
28  plugins-server/cloud9.ide.revisions/revisions.js
@@ -53,6 +53,7 @@ module.exports = function setup(options, imports, register) {
53 53
             });
54 54
         }, 1);
55 55
 
  56
+
56 57
         this.command = function(user, message, client) {
57 58
             if (!message.command || message.command !== "revisions") {
58 59
                 return false;
@@ -124,16 +125,15 @@ module.exports = function setup(options, imports, register) {
124 125
                             if (err) {
125 126
                                 return _error("There was a problem reading the contents for the file " +
126 127
                                         message.path + ":\n" + err);
  128
+                            }
127 129
 
128  
-                              }
129  
-
130  
-                              user.broadcast(JSON.stringify({
131  
-                                  type: "revision",
132  
-                                  subtype: "getRealFileContents",
133  
-                                  path: message.path,
134  
-                                  nextAction: message.nextAction,
135  
-                                  contents: data
136  
-                              }));
  130
+                            user.broadcast(JSON.stringify({
  131
+                                type: "revision",
  132
+                                subtype: "getRealFileContents",
  133
+                                path: message.path,
  134
+                                nextAction: message.nextAction,
  135
+                                contents: data
  136
+                            }));
137 137
                         });
138 138
                         break;
139 139
 
@@ -277,6 +277,7 @@ module.exports = function setup(options, imports, register) {
277 277
 
278 278
             // Path of the final backup file inside the workspace
279 279
             var absPath = this.getRevisionsPath(filePath + "." + FILE_SUFFIX);
  280
+
280 281
             var self = this;
281 282
             // does the revisions file exists?
282 283
             fs.exists(absPath, function (exists) {
@@ -433,6 +434,7 @@ module.exports = function setup(options, imports, register) {
433 434
             if (!path) {
434 435
                 return callback(new Error("Missing or wrong parameters (path, revision):", path, revision));
435 436
             }
  437
+
436 438
             var absPath = this.getRevisionsPath(path + "." + FILE_SUFFIX);
437 439
             var revObj;
438 440
             fs.exists(absPath, function(exists) {
@@ -450,7 +452,7 @@ module.exports = function setup(options, imports, register) {
450 452
                             silentsave: true,
451 453
                             restoring: false,
452 454
                             patch: [Diff.patch_make("", data)],
453  
-                            length: data.length,
  455
+                            length: data.length
454 456
                         };
455 457
                         var revisionString = JSON.stringify(firstRevision);
456 458
                         revObj = {};
@@ -461,8 +463,7 @@ module.exports = function setup(options, imports, register) {
461 463
                 }
462 464
                 else if (revision) {
463 465
                     fs.readFile(absPath, "utf8", write);
464  
-                }
465  
-                else {
  466
+                } else {
466 467
                      callback(new Error("Missing or wrong parameters (path, revision):", path, revision));
467 468
                 }
468 469
             });
@@ -484,6 +485,7 @@ module.exports = function setup(options, imports, register) {
484 485
                         revision: revision.ts
485 486
                     };
486 487
                 }
  488
+
487 489
                 fs.writeFile(absPath, content, "utf8", function(err) {
488 490
                     callback(err, returnValue);
489 491
                 });
@@ -497,7 +499,5 @@ module.exports = function setup(options, imports, register) {
497 499
             }
498 500
         };
499 501
     }
500  
-
501 502
     require("util").inherits(RevisionsPlugin, Plugin);
502 503
 };
503  
-

0 notes on commit 5afbc9e

Please sign in to comment.
Something went wrong with that request. Please try again.