Skip to content

Instantly share code, notes, and snippets.

@bluegraybox
Created August 29, 2011 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bluegraybox/1178329 to your computer and use it in GitHub Desktop.
Save bluegraybox/1178329 to your computer and use it in GitHub Desktop.
SVN update wrapper for teams
#!/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