Skip to content

Instantly share code, notes, and snippets.

@rgov
Created July 23, 2011 00:25
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 rgov/1100746 to your computer and use it in GitHub Desktop.
Save rgov/1100746 to your computer and use it in GitHub Desktop.
#!/bin/bash -e
if [ "$1" = "store" ]; then
echo -n "Archiving Subversion metadata... "
find . -name '.svn' -type d -print0 > .svn.tmp
xargs -0 tar cf .svn.tar < .svn.tmp
xargs -0 rm -Rf < .svn.tmp
rm -f .svn.tmp
echo "done."
elif [ "$1" = "restore" ]; then
echo -n "Restoring Subversion metadata... "
tar xf .svn.tar
rm -f .svn.tar
echo "done."
else
echo "usage: $(basename "$0") [ store | restore ]" >&1
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment