Skip to content

Instantly share code, notes, and snippets.

@toshsan
Created March 6, 2015 22:06
Show Gist options
  • Select an option

  • Save toshsan/cc56e90a2b66cfd79608 to your computer and use it in GitHub Desktop.

Select an option

Save toshsan/cc56e90a2b66cfd79608 to your computer and use it in GitHub Desktop.
enlist recursive trunks from Subversion
#!/bin/sh
if [ "help$1"=="help" ] || [ "$1"=="help" ]; then
echo "usage--- \nenlist http://svn/rootpath"
exit 1
fi
URL=$1
ROOTDIRS=$(svn ls $URL)
for DIR in $ROOTDIRS; do
trunk="$URL/${DIR}trunk"
echo "$DIR"
if [ ! -d $DIR ] && $(svn info $trunk >/dev/null 2>/dev/null) ; then
echo "Enlisting: $DIR from $trunk"
svn co $trunk $DIR
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment