Search code examples
c#.netmercurialkiln

Connect to Kiln mercurial repository using C#


I use Kiln.Net library to connect to mercurial repository. I need to get base information (commits, lines of code changed..). Then it should group that info further to show progress for each author. But still have no success.

Code to connect:

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);
}

While debuggin I got that auth URL seems good. It is like:

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

But after execute request I always getting 404 error Not Found. Thanks in advance for your help


Solution

  • The problem was fixed. Kiln.Net library was generating bad URL. Good one is just without "/Kiln":

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