I'm trying to get a list of changed files from SharpSVN. I can get the data I need on the command line like this:
svn diff -r <startrev>:HEAD --summarize --xml
Can somebody point me to the right spot in the SharpSVN maze to replicate this? Ideally, I'd be able to get a collection of the changed files out, but I can parse a stream if needs be.
The SharpSvn equivalent of svn diff --summarize
is 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 the results as they come in.
Or you can use .GetDiffSummary()
if you want to access the final result as a list.
there is simplest way to do that but here is some different approch :
with sharpsvn use the Status command to retrive the all files status in both WorkingCopy and Repository Status and then compare between them
example :
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;
}
}));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With