How to find a list of files modified between two subversion revisions?

Starting with a background before I get into the details, I work on large projects that sometimes run over a year. We normally start from a clean branch out of the trunk at the time of development initiation. I have 8 developers working with me and we end up modifying quite a few files per day. Maintaining a accurate list of files modified manually for the project is a real pain. But when the project development completes, one of the things that we need to present back to the Application Team is something called “Deliverable Document” that outlines what files were modified and a summary of changes that were done on those files.

For few of the projects that I worked on, we did maintain this manual list of added/modified/deleted files. The problem with that is if any developer knowingly or unknowingly forgets to update the list with his/her files, the list becomes inaccurate. Then I started thinking to myself, there got to be a better way. We use subversion. Everytime we commit a file, the developers do put a note on what modifications were done on the files that they are committing. Since subversion maintains revisions, I started thinking there should be a way to get this list from the start of the project to the end of it with all those commit notes entered by developers for each revision. Then I found out a solution.

You will need a command line svn tool, if you don’t have already. I used Slik SVN. Since my svn clients (tortoiseSVN and Subclipse) use subversion 1.7.4, I downloaded the matching version.

I started experimenting with the svn diff command. I was able to produce a difference between two versions. But that’s not what I wanted. I didn’t want to know specific lines of code changes within each files.

svn diff -r 43099:45207

Then I started experimenting with the svn log command. But the following command I used produced only the commit notes between those two revisions.

svn log -r 43099:45207

Researching and experimenting further, I found out that svn log command takes a -v parameter which produces a list of files modified. Bingo ! That’s what I needed.

svn log -r 43099:45207 -v

But I had over 500 files modfied and the files were spit out on the console. I really wanted them to be exported on a file. I accomplished that by adding extra out stream parameters to the command.

svn log -r 43099:45207 -v >>c:/diff.txt

I had exactly what I needed. Didn’t need to maintain the manual list.

Here is the sample file that was generated by running this command (well I had to strip off several files from the results)

It however comes with extra work. If you modified the same file over multiple revisions. It will list those files multiple times with notes for each revision.

I simply use excel spreadsheet to consolidate those files and notes. But it’s better than having a probably incorrect list of files.

When the projects are long running, we do sync the code from trunk on bo-weekly basis after the production release. When merging from another branch occurs, this output produced by running commands above contains a definitive indication of where it got merged from – so those files could potentially be excluded from your deliverable (If you did not modify the same file with your project)