3

I am using SharpSvn to work with svn in my C# project. At the moment, I want to clean up everything( including change/unversioned files ) before checkout news from svn.

I already call SvnClient.Revert() and SvnClient.Cleanup(), but it's seem that unversioned files are not cleaned up.

        try
        {
            // try to revert first because if we modify the SVN directory
            SvnClient.CleanUp(targetDir);
            SvnClient.Revert(targetDir);
        }
        catch (Exception e)
        {
            LogHelper.Warn<SvnService>(StringHelper.LogFormat(LogMessage.SvnRevertFailed, targetDir));
        }

        try
        {
            return SvnClient.CheckOut(new Uri(sourceUrl), targetDir);
        }

Did I missed something?

Any help is highly appreciate!

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
Nhan Phan
  • 1,262
  • 1
  • 14
  • 32
  • Probably a good time to migrate to some form of Git. – Piotr Kula Jan 28 '19 at 08:37
  • @ppumkin: I totally agree with you, but my customer don't think so. Customer is always right LOL – Nhan Phan Jan 28 '19 at 08:41
  • 1
    Well you know what to do. Charge a premium for using SVN and suggest it will be cheaper if they move to GIT.. Surprising how quickly they change their minds – Piotr Kula Jan 28 '19 at 08:44
  • 2
    `svn revert` is used to revert changes and `svn cleanup` to finish uncompleted tasks. I am afraid, there is no command to deleted unversioned files, but if you are using SharpSvn to identify files under version control, you could delete all other files within the given directory by yourself – royalTS Feb 06 '19 at 12:11

0 Answers0