How to get a list of modified files in SharpSVN (e.g. svn diff --summarize --xml)

I am trying to get a list of modified files from SharpSVN. I can get the data I need on the command line as follows:

svn diff -r <startrev>:HEAD --summarize --xml

Can someone point me to the right place in the SharpSVN maze to reproduce this? Ideally, I could get a collection of modified files, but I can analyze the stream if necessary.

+5
source share
2 answers

SharpSvn equivalent svn diff --summarizeis SvnClient.DiffSummary().

You can use it as

using (var client = new SvnClient())
{
   var location = new Uri("http://my.example/repos/trunk");
   client.DiffSummary(new SvnUriTarget(location, 12), new SvnUriTarget(location, SvnRevision.Head),
                      delegate(object sender, SvnDiffSummaryEventArgs e)
                      {
                        // TODO: Handle result
                      });
}

when you want to get results as they become available.

Or you can use .GetDiffSummary()it if you want to get the final result as a list.

+4
source

, :

sharpsvn , WorkCopy Repository,

:

using (SvnClient cl = new SvnClient())
  cl.Status(YourPath, new SvnStatusArgs {
    Depth = SvnDepth.Infinity, ThrowOnError = true,
    RetrieveRemoteStatus = true, Revision = SvnRevision.Head}, 
    new EventHandler<SvnStatusEventArgs>(
       delegate(object s, SvnStatusEventArgs e) {
          switch (e.LocalContentStatus) {
             case SvnStatus.Normal:break;
             case SvnStatus.None: break;
             case SvnStatus.NotVersioned: break;
             case SvnStatus.Added:break;
             case SvnStatus.Missing: break;
             case SvnStatus.Modified: break;
             case SvnStatus.Conflicted: break;
             default: break;
          }
          switch (e.RemoteContentStatus) {
             case SvnStatus.Normal:break;
             case SvnStatus.None: break;
             case SvnStatus.NotVersioned: break;
             case SvnStatus.Added:break;
             case SvnStatus.Missing: break;
             case SvnStatus.Modified: break;
             case SvnStatus.Conflicted: break;
             default: break;
          }
       }));
+2

All Articles