Code Build Status

Mercurial.Net

Project page: http://mercurialnet.codeplex.com.

Overview

The Mercurial.Net project was spawned because I wanted to add support for Mercurial into one of my programs, and could not find a good existing library to do so, so I decided to write one myself. Since I saw many questions on various sites online asking for such a library, I decided to put enough work into it to make it usable by others, and make it a model class library (at least in my opinion.)

Mercurial.Net basically wraps around the command line client of Mercurial, constructing the right commands and options to it, and parsing the output from the client back into .NET objects. This means that, other than knowledge about Mercurial, the programmer that uses Mercurial.Net does not need to parse log output or understand what exit codes are valid, etc. All of that is taken care of by the class library.

The class library is also written in such a way to allow the programmer to extend the library with support for third party Mercurial extensions that I don't support or even know about, in a way that makes the extensions feel like a natural part of the library itself.

The class library is written in C# 3.0, for .NET 3.5 and 4.0, in a Visual Studio 2010 solution.

Example

var repo = new Repository("C:\Development\Mercurial.Net");
repo.Clone("https://hg01.codeplex.com/mercurialnet");
repo.Update();
// do some changes in the local working folder
repo.Commit("Added some changes");
repo.Push();

Releases and downloads

The software is not yet released, other than being hosted online on CodePlex in source form. The library still has a ways to go before it is feature-complete and fully tested, but should now have reached a stable API format. This means that you're free to download and experiment with the library, even incorporate it into programs of your own, but note that there are most certainly bugs, and not all the Mercurial commands are supported yet.

Source code repository - Mercurial repository hosted on CodePlex
Online documentation - build with Sandcastle.