使用C#连接到Kiln mercurial存储库

时间:2014-08-01 12:57:14

标签: c# .net mercurial kiln

我使用Kiln.Net库连接到mercurial存储库。我需要获取基本信息(提交,代码行改变..)。然后它应该进一步分组该信息以显示每个作者的进度。但仍然没有成功。

连接代码:

var account = "exampleRepo"; // examplerepo.kilnhg.com
var user = "exampleUsername"; // username
var password = "examplePassword"; // password

using (Kiln myAccount = Kiln.AuthenticateOnDemand(account, user, password)) // Here 404 error
{
    // Returns changeset history for the repository
    Changeset[] changesets;
    changesets = myAccount.GetHistory(repo.ID, 100);

    // Returns the list of all available projects
    Project[] projects;
    projects = myAccount.GetProjects();
    projects = myAccount.Call<Project[]>(KilnApiCall.Projects, null);
}

虽然debuggin我得到了auth URL似乎很好。它就像:

https://exampleRepo.kilnhg.com/Kiln/Api/1.0/Auth/Login?sUser=exampleUsername&sPassword=examplePassword

但在执行请求后,我总是收到404错误。在此先感谢您的帮助

1 个答案:

答案 0 :(得分:0)

问题得到解决。 Kiln.Net库生成了错误的URL。好的就是没有&#34; / Kiln&#34;:

https://exampleRepo.kilnhg.com/Api/1.0/Auth/Login?sUser=exampleUsername&sPassword=examplePassword