Getting files to be committed code problems

111 Views Asked by At

BACKGROUND: What I am trying to do is output a list of files which are unversioned or have had changes done to them and need to be commited.

WHAT IVE TRIED: I am currently using the code below, the code runs but nothing is outputted to the console. The catch method isnt activated either as the message box doesnt appear.

using (SvnClient client = new SvnClient())
{
    try
    {
        EventHandler<SvnStatusEventArgs> statusHandler = new EventHandler<SvnStatusEventArgs>(HandleStatusEvent);
        client.Status(Properties.Settings.Default.LocalFolderPath + @"\" + project, statusHandler);
    }
    catch
    {
        MessageBox.Show("ERROR");
    }
}


private void HandleStatusEvent(object sender, SvnStatusEventArgs args)
{
    switch (args.LocalContentStatus)
    {
        case SvnStatus.NotVersioned: // Handle appropriately
            Console.WriteLine(args.ChangeList);
            break;
    }

    // review other properties of 'args'
}

Im not quite sure if this is the right code to get the list of files which need to be committed as the documentation is poor. Ive looked on this site and have found a few other methods (similar to this way) but I still cant get it working. can anyone help?

0

There are 0 best solutions below