我正在使用Mercurial.NET,我需要获取一个或多个文件的状态(提交,修改等)。
我如何使用Mercurial.NET或至少使用Mercurial来执行此操作?
基本上,我需要以某种方式向status命令提供所需文件的路径。
我不想获取所有文件及其状态的列表,并根据其路径过滤它们。
我看到TortoiseHG会这样做,但我无法弄清楚如何在cmd-line或Mercurial.NET中做到这一点。
答案 0 :(得分:0)
我现在看到了:
hg status <path_to_file_in_the_repo>
似乎做我想要的。 在Mercurial.NET中它是:
var repo = new Repository(path);
var s = new StatusCommand();
s = s.WithInclude(FileStatusIncludes.Modified)
.WithAdditionalArgument("\"" + file + "\"")
.WithTimeout(1000);
s.Validate();
var ret = repo.Status(s);