ローカルリポジトリ用のnode.js用のMercurial HGライブラリ
質問
Node.js用に書かれたライブラリを探しています。これは、WebアプリケーションからMercurial HGで作成されたローカルリポジトリを管理するために使用できます。
誰かがそのようなものを実装しましたか?
他のヒント
NPMで利用可能なモジュールを作成しました node-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