PullCommand and PushCommand

Aug 17, 2012 at 6:46 PM

Hello there

I am doing some experiment with Mercurial.NET and trying to do very basic stuff like pull, update etc.., see code below. I ended up missing a piece of the puzzle where I need to know when I call the pull command it is output whether it is done successfully or not and if not what is the error or feedback? I came across a functions called After and Before as part of CommandBase but not how to access them and if they can do what I am looking for.

Please have a look at my code below and let me know how can I capture the pull command output. Your prompt response is highly apreciated.


static void Main(string[] args) {

                       string tortoiseHGPath = System.Configuration.ConfigurationManager.AppSettings["tortoisehgpath"];           

string repoPath = System.Configuration.ConfigurationManager.AppSettings["repositorypath"];                       try{


                              Repository repo = new Repository(repoPath);               

                             var changesetList = repo.Incoming();               

                             if (changesetList.Any()){

                                 repo.Pull(new PullCommand {  Update=true}.WithTimeout(10000));                                        }           


                       catch (Exception exp)  {                eventLogObj.eventLog.WriteEntry(exp.Message);