Jan. 13, 2010 at 1:28pmSVN Files Since Revision

Need List of File Since a Revision

An SVN command that gives a list of modified files between revisions. It is very useful when uploading files to a live server and when running through quality assurance. Another command to keep in your bag of tricks.
SVN version control is really good at group collaboration. While working on a work order or module there tends to be a list of revisions associated. After the team is done, the changed files need to be uploaded to a live server. This is usually done through FTP or SCP, file by file. And occasionally one is missed because we don't have a list of all the files that have changed during a session. (SVN has a history command that gives history per revision, but not collectively between revisions)

But there is a way to get such a file listing. Just recently I discovered the SVN diff command. It will take a range of revision numbers and display all the changes in text between them. Add the summarize switch and you now have a handy file listing. The command is shown below.
svn diff -r [REVNUM]:HEAD --summarize
This information can be used for a great many things. It can create a check list when uploading modified files. It can be used to audit that a particular revision is up live. It can aid in quality assurance tests. And it can even be used to automate the upload procedure.

Do you see any other uses for this list? Let us know in the comments!

An easy way to avoid the file upload problem is to host a Subversion client on the live server as well. Then you can check out the files on the live server and simply do "svn update" to keep the live server up-to-date with the changes made by the team in the development environment. You can also update to specific revisions if you are further along (or behind on QA) at the HEAD revision than you want to be on the live server. Updating to specific revisions also works in reverse (update to an older, well-tested working revision), in case you find a bug or something that needs to be addressed after things go live.

I've been using this approach on a recent project and it works very well.

Left by Bernie Zimmermann | Jan. 13, 2010 at 10:39pm

Bernie: yep, that is the ideal way to accomplish live site updates. We have developed our own application to manage and deploy updates to sites using the SVN client on both our local server and the live servers using a standard tagging system. But there's always a site or two that is hosted off-site where the diff command comes in very handy!

Left by Mark at SC | Jan. 14, 2010 at 11:06am

You can take this further, and have subversion produce the actual files for you, not just a list of files to work off, which cuts down the amount of time spent copying / uploading to a minimum.

I wrote about this on my blog here:

http://tall-paul.co.uk/?p=47

not spam, honest!

Left by PaulB | Mar. 8, 2010 at 6:16am

Leave a Comment

Remember me

Name:

Email:

URL:

Comment: * No HTML, http:// will auto-link
* required
Comment Guidelines