Created
August 29, 2011 12:52
-
-
Save bluegraybox/1178329 to your computer and use it in GitHub Desktop.
SVN update wrapper for teams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update current SVN directory, creating diff & log files from previous version. | |
# For seeing what the rest of your team did. | |
last_rev=$(svn info | grep "^Revision: ") | |
last_rev=${last_rev#Revision: } | |
echo "Updating from $last_rev..." | |
svn up | |
new_rev=$(svn info | grep "^Revision: ") | |
new_rev=${new_rev#Revision: } | |
if [[ "$last_rev" == "$new_rev" ]] ; then | |
echo "No changes" | |
else | |
base=$last_rev-$new_rev | |
echo "Generating svn diff file" | |
svn diff -r $last_rev:$new_rev > $base.diff | |
# log should not include last_rev | |
start_rev=$((last_rev + 1)) | |
echo "Generating svn log file" | |
svn log -v -r $new_rev:$start_rev > $base.log | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment