0

I would like to get the list of files that were modified, added or removed in a specific revision using sharpsvn. I can get that info using command line, for example:

C:\svn>svn log --verbose -r 123
------------------------------------------------------------------------
r123 | rmercado | 2018-09-26 01:15:18 -0500 (wed., 26 Set. 2018) | 1 line
Changed paths:
   A /branches/folder/file1.txt
   A /branches/folder/file2.txt
   M /branches/folder/file3.txt
   D /branches/folder/file4.txt

changes made to branch
------------------------------------------------------------------------

Thanks for your help,

Raul Mercado
  • 324
  • 1
  • 4
  • 14
  • You should take a look at the `SvnClient.GetLog()` method: http://docs.sharpsvn.net/current/html/M_SharpSvn_SvnClient_GetLog_4.htm with the arguments class: http://docs.sharpsvn.net/current/html/AllMembers_T_SharpSvn_SvnLogArgs.htm. This should provide you the necessary functionality. Unfortunately, the documentation of SharpSvn is not the best – royalTS Oct 09 '18 at 10:04

1 Answers1

0

Take a look at the below code. ChangedPaths Collection in the instance of SvnLogEventArgs will contain the details of the files changed in commit. In the below code "svnLog.ChangedPaths" contains the details.

Extract from one of my Test application.

            Collection<SvnLogEventArgs> SvnLogList = new Collection<SvnLogEventArgs>();
            SvnRevisionRange range = new SvnRevisionRange(new SvnRevision(this.dtpFromDate.Value), new SvnRevision(this.dtpToDate.Value));
            new SvnClient().GetLog(new Uri(this.txtRepoPath.Text.Trim()), new SvnLogArgs(range), out SvnLogList);

            foreach (SvnLogEventArgs svnLog in SvnLogList)
            {
                CommitLogList.Add(new CommitLog(
                    svnLog.Author,
                    svnLog.LogMessage,
                    svnLog.Revision,
                    svnLog.Time,
                    svnLog.ChangedPaths.Select(cp => cp.Path).ToList()
                    ));
            }
Shekar Gurram
  • 99
  • 1
  • 5