Skip to content

Instantly share code, notes, and snippets.

@nahakiole
Last active August 29, 2015 14:06
Show Gist options
  • Save nahakiole/51b21e99cdded5491170 to your computer and use it in GitHub Desktop.
Save nahakiole/51b21e99cdded5491170 to your computer and use it in GitHub Desktop.
Create a patch with the full files from a revision
function createSVNPatch {
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit
fi
svn log -v -r$1 | awk '/\//{print $2}' | sed ""s/$(svn info | grep "Relative" | grep --only-matching -E "/.*" | cut -c 1- | sed -e 's/\//\\\//g')//g"" | cut -c 2- | while read x ; do mkdir -p /tmp/$1/$(echo $x | rev | cut -d'/' -f2- | rev); svn cat -r32804 $x > /tmp/$1/$x ; done && cd /tmp/$1 && zip ~/$1.zip * && cd -
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment