Permalink
Browse files

[fix] Changed require('sys') to require('util') for compatibility wit…

…h node v0.8
  • Loading branch information...
1 parent 7070d8b commit 0fc4c2f05f3d4d43055150f04fd12628c2e75ee0 @blakmatrix blakmatrix committed Jun 23, 2012
@@ -1,6 +1,6 @@
var Repo = require('git/repo').Repo,
- sys = require('sys'),
+ util = require('util'),
fs = require('fs'),
exec = require('child_process').exec;
@@ -14,7 +14,7 @@ var create_tmp_directory = function(clone_path, callback) {
// Copy the old directory to the new one
var child = exec('cp -R ' + clone_path + ' ' + tmp_path, function (error, stdout, stderr) {
if (error !== null) {
- sys.puts('exec error: ' + error);
+ util.puts('exec error: ' + error);
return callback(error, null);
}
return callback(null, tmp_path);
@@ -25,7 +25,7 @@ var destroy_directory = function(directory, callback) {
// Copy the old directory to the new one
var child = exec('rm -rf ' + directory, function (error, stdout, stderr) {
if (error !== null) {
- sys.puts('exec error: ' + error);
+ util.puts('exec error: ' + error);
return callback(error, null);
}
return callback(null, null);
@@ -125,7 +125,7 @@ var execute_process = function(type) {
var end_time = new Date();
var total_miliseconds = end_time.getTime() - start_time.getTime();
- sys.puts("[" + type + "]::executed in: " + (total_miliseconds/1000) + " seconds");
+ util.puts("[" + type + "]::executed in: " + (total_miliseconds/1000) + " seconds");
// Delete the directory
destroy_directory(target_path, function(err, result) {});
});
@@ -144,7 +144,7 @@ if(process.argv.length > 2 && process.argv[2].match(/packobj|commits1|commits2|b
execute_process(process.argv[2]);
}
} else {
- sys.puts("Please provide the benchmark you wish to run in the form <node benchmarks [packobj|commits1|commits2|big_revlist|log|diff|commit_diff|heads|all]>")
+ util.puts("Please provide the benchmark you wish to run in the form <node benchmarks [packobj|commits1|commits2|big_revlist|log|diff|commit_diff|heads|all]>")
}
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
SequenceCallbacks = require('./callbacks').SequenceCallbacks,
ContextChange = require('./change').ContextChange,
Change = require('./change').Change,
@@ -762,7 +762,7 @@ Difference.LCS.__normalize_patchset = function(patchset) {
});
}
} else {
- throw "Cannot normalize the hunk: " + sys.inspect(hunk);
+ throw "Cannot normalize the hunk: " + util.inspect(hunk);
}
}));
}
View
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
Actor = exports.Actor = function(name, email) {
var _name = name, _email = email;
@@ -222,25 +222,25 @@ p.encode_utf8 = function(s) {
};
p.pprint = function(s) {
- var sys = require('sys');
+ var util = require('util');
for (var i=0; i<s.length; i++) {
- if (s.charCodeAt(i)<32) {sys.puts(s.charCodeAt(i)+' : ');}
- else {sys.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
+ if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
+ else {util.puts(s.charCodeAt(i)+' : '+ s.charAt(i));}
}
};
p.hprint = function(s) {
- var sys = require('sys');
+ var util = require('util');
for (var i=0; i<s.length; i++) {
- if (s.charCodeAt(i)<32) {sys.puts(s.charCodeAt(i)+' : ');}
- else {sys.puts(s.charCodeAt(i).toString(16)+' : '+ s.charAt(i));}
+ if (s.charCodeAt(i)<32) {util.puts(s.charCodeAt(i)+' : ');}
+ else {util.puts(s.charCodeAt(i).toString(16)+' : '+ s.charAt(i));}
}
};
p.hex = function(s) {
- var sys = require('sys');
+ var util = require('util');
var string = ''
for (var i=0; i<s.length; i++) {
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
Actor = require('./actor').Actor,
Diff = require('./diff').Diff;
Tree = require('./tree').Tree;
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs');
var FileIndex = exports.FileIndex = function(repo_path, callback) {
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
Buffer = require('buffer').Buffer;
@@ -32,7 +32,7 @@ FileWindow.prototype.index = function(idx) {
offset = idx[0];
len = idx[1]
} else {
- throw "invalid index param: " + sys.inspect(idx);
+ throw "invalid index param: " + util.inspect(idx);
}
// Seek position equivalent using a position in the read
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
GitFileOperations = require('./git_file_operations').GitFileOperations,
exec = require('child_process').exec,
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
exec = require('child_process').exec;
@@ -117,7 +117,7 @@ GitFileOperations.fs_rmdir_r = function(dir, callback) {
// Copy the old directory to the new one
var child = exec('rm -rf ' + dir, function (error, stdout, stderr) {
if (error !== null) {
- sys.puts('exec error: ' + error);
+ util.puts('exec error: ' + error);
return callback(error, null);
}
return callback(null, null);
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
Tree = require('./tree').Tree,
Config = require('./config').Config;
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
Commit = require('./commit').Commit;
var Head = exports.Head = function(name, commit) {
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
var GitBlob = exports.GitBlob = function(content, repository) {
var _content = content, _repository = repository;
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
UserInfo = require('../user_info').UserInfo;
var GitCommit = exports.GitCommit = function(tree, parent, author, committer, message, headers, repository) {
@@ -51,7 +51,7 @@ GitCommit.from_raw = function(raw_object, repository) {
committer = new UserInfo(value);
} else {
// Unknow header
- sys.puts("unknow header '" + key + "' in commit " + raw_object.sha_hex())
+ util.puts("unknow header '" + key + "' in commit " + raw_object.sha_hex())
}
})
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
UserInfo = require('../user_info').UserInfo;
var GitTag = exports.GitTag = function(object, type, tag, tagger, message, repository) {
@@ -48,7 +48,7 @@ GitTag.from_raw = function(raw_object, repository) {
} else if(key == 'tagger') {
tagger = new UserInfo(value);
} else {
- sys.puts("unknown header '" + key);
+ util.puts("unknown header '" + key);
}
});
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
BinaryParser = require('../binary_parser').BinaryParser,
DirectoryEntry = require('../internal/directory_entry').DirectoryEntry;
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
BinaryParser = require('./binary_parser').BinaryParser,
Zlib = require('../zlib/zlib').Zlib,
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
// All the mime types
var mime_definition = " # application/*\n\
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
fs = require('fs'),
Buffer = require('buffer').Buffer,
BinaryParser = require('./binary_parser').BinaryParser,
@@ -1,5 +1,5 @@
var crypto = require('crypto'),
- sys = require('sys'),
+ util = require('util'),
Buffer = require('buffer').Buffer,
BinaryParser = require('./binary_parser').BinaryParser;
View
@@ -2,7 +2,7 @@ var Head = require('./head').Head,
Git = require('./git').Git,
Commit = require('./commit').Commit,
fs = require('fs'),
- sys = require('sys'),
+ util = require('util'),
Tree = require('./tree').Tree,
Blob = require('./blob').Blob,
Head = require('./head').Head,
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
GitObject = require('./git_object').GitObject,
fs = require('fs'),
LooseStorage = require('./loose_storage').LooseStorage,
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
GitFileOperations = require('./git_file_operations').GitFileOperations,
StatusFile = require('./status_file').StatusFile;
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
var StatusFile = exports.StatusFile = function(repo , hash) {
var _repo = repo;
@@ -1,4 +1,4 @@
-var sys = require('sys');
+var util = require('util');
var Submodule = exports.Submodule = function(repo, id, mode, name) {
var _repo = repo, _id = id, _mode = mode, _name = name;
View
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
Submodule = require('./sub_module').Submodule,
Blob = require('./blob').Blob;
@@ -1,4 +1,4 @@
-var sys = require('sys'),
+var util = require('util'),
StringUtil = require('../sprintf/sprintf').StringUtil;
var UserInfo = exports.UserInfo = function(string) {
Oops, something went wrong.

0 comments on commit 0fc4c2f

Please sign in to comment.