0

I want the output in numbers: how many lines added how many lines deleted how many lines modified

is it possible with Jenkins if yes then how. is there any other svn command or any other method to get the desired results.

  • I am using Windows environment. what i need is getting difference of 2 SVN revision the output should give me. 1) Total new files 2) Total deleted files 3) Total modified files 4) Total untouched files 5) Total New lines 6) Total Deleted lines 7) Total modified lines and in a table it should also show added deleted modified type. – Manoj chhablani Aug 07 '15 at 09:14

1 Answers1

0

Yes, it is possible, but you will be able to get a more specific answer if you provide more details in your question about your environment and what you're trying to accomplish.

I'll assume you're running on Linux and that you always want to compare the current revision with the previous revision.

  1. Install diffstat, which is available for most Linux distributions and may be present by default on OS X.

  2. Create a job that runs the following bash shell script:

    previous=$(($SVN_REVISION-1)) svn diff -r $previous | diffstat -m -s

Explanation:

  • Calculate the previous revision by subtracting one from the SVN_REVISION environment variable provided by Jenkins.
  • svn diff -r generates the diff
  • diffstat -m tries to compute modifications, -s outputs just the summary

See also Using diffstat with subversion.

Community
  • 1
  • 1
Dave Bacher
  • 15,652
  • 3
  • 63
  • 86
  • I am using Windows environment. what i need is getting difference of 2 SVN revision the output should give me. 1) Total new files 2) Total deleted files 3) Total modified files 4) Total untouched files 5) Total New lines 6) Total Deleted lines 7) Total modified lines and in a table it should also show added deleted modified type. – Manoj chhablani Aug 07 '15 at 09:13
  • Please post the answer. – Manoj chhablani Aug 13 '15 at 12:07
  • @Manojchhablani, I'm sorry, I don't have an answer that fits all of your requirements. I think it's likely that you will need to write this tool yourself. – Dave Bacher Aug 14 '15 at 16:53
  • I have one shell script which does it all but i don't know how to run this script using Jenkins. – Manoj chhablani Aug 17 '15 at 07:56