node.js的Mercurial HG库,用于本地存储库
题
我正在寻找为node.js编写的库,我将能够从我的本地存储库中使用Mercurial HG创建的Web应用程序来管理。
有人实施了这样的事情吗?
其他提示
我在NPM上创建了一个可用的模块 节点-HG 正是出于这个原因。
这是周围的包装纸 命令服务器 通过 stdin
和解析输出 stdout
.
这是一个如何工作的示例:
var path = require("path");
var hg = require("hg");
// Clone into "../example-node-hg"
var destPath = path.resolve(path.join(process.cwd(), "..", "my-node-hg"));
hg.clone("http://bitbucket.org/jgable/node-hg", destPath, function(err, output) {
if(err) {
throw err;
}
output.forEach(function(line) {
console.log(line.body);
});
// Add some files to the repo with fs.writeFile, omitted for brevity
hg.add(destPath, ["someFile1.txt", "someFile2.txt"], function(err, output) {
if(err) {
throw err;
}
output.forEach(function(line) {
console.log(line.body);
});
var commitOpts = {
"-m": "Doing the needful"
};
// Commit our new files
hg.commit(destPath, commitOpts, function(err, output) {
if(err) {
throw err;
}
output.forEach(function(line) {
console.log(line.body);
});
});
});
});
不隶属于 StackOverflow