Friday, October 1, 2010

changed files between two svn branch revisions

#!/bin/bash
#auther sanjeewaf
if [ ! $1 ] || [ ! $2 ] || [ ! $3 ] ; then
echo "Please enter a revision from, revision to, and SVN repository"
exit
fi

# set up nice names for the incoming parameters to make the script more readable
revision_from=$1
revision_to=$2
repository=$3

# the grep is needed so we only get added/modified files and not the deleted ones or anything else
# if it's a modified directory it's " M" so won't show with this command (good)
# if it's an added directory it's still "A" so will show with this command (not so good)

for line in `svn diff --summarize -r$revision_from:$revision_to $repository`
do
echo $line
done

# to summarize any deleted files or directories at the end of the script uncomment the following line
#svn diff --summarize -r$revision_from:$revision_to $repository | grep "^[D]"
#eg : 20 25 svn://localhost/myrepository

No comments:

Post a Comment