Exporting only the files changed between 2 revisions in Subversion
Published 05/20/2008 by Rodney Amato
Say you are just about ready to do a release of your project and you want to work out what files have changed for creating a changelog. Or maybe you want to have all the files in 1 directory for creating a zip to send to someone, or to copy over a test copy to test upgrading etc.
Using the below command you just need to change the two revision numbers (1403 and 1438 in the example) and the path to your repository (http://server/svn/project/trunk in the example below) and the command will export all the files that have changed between the two revisions.
I've only tested the command in bash but it should work in zsh too. Not sure about any other shells. Also make sure that you have the trailing / in the sed part of the command otherwise it won't work properly.
for i in $(svn diff --summarize -r 1403:1438 http://server/svn/project/trunk | awk '{ print $2 }'); do p=$(echo $i | sed -e 's{http://server/svn/project/trunk/{{'); mkdir -p $(dirname $p); svn export $i $p; done
If you just wanted to get a list of the changed files you could run the command
svn diff --summarize -r 1403:1438 http://server/svn/project/trunk | awk '{ print $2 }' | sed -e 's{http://server/svn/project/trunk/{{'
Using the below command you just need to change the two revision numbers (1403 and 1438 in the example) and the path to your repository (http://server/svn/project/trunk in the example below) and the command will export all the files that have changed between the two revisions.
I've only tested the command in bash but it should work in zsh too. Not sure about any other shells. Also make sure that you have the trailing / in the sed part of the command otherwise it won't work properly.
for i in $(svn diff --summarize -r 1403:1438 http://server/svn/project/trunk | awk '{ print $2 }'); do p=$(echo $i | sed -e 's{http://server/svn/project/trunk/{{'); mkdir -p $(dirname $p); svn export $i $p; done
If you just wanted to get a list of the changed files you could run the command
svn diff --summarize -r 1403:1438 http://server/svn/project/trunk | awk '{ print $2 }' | sed -e 's{http://server/svn/project/trunk/{{'
