Skip to content

Instantly share code, notes, and snippets.

@timlevett
Last active October 20, 2015 17:07
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 timlevett/54ce2adc08a9e8823387 to your computer and use it in GitHub Desktop.
Save timlevett/54ce2adc08a9e8823387 to your computer and use it in GitHub Desktop.
Checkout a bunch of projects under a SVN repo
function look_and_co_if_trunk {
BASE_URL=$1
PARENT=$2
SUPER_BASE=${BASE_URL}${PARENT}
LIST=`svn list $SUPER_BASE`
if [ "`echo $LIST | grep trunk | wc -l`" = "1" ] ; then
echo "found trunk at $SUPER_BASE"
svn co $SUPER_BASE/trunk ${PARENT}
SUPER_BASE=$BASE_URL
else
for item in $LIST ; do
echo "recursively calling into $item";
look_and_co_if_trunk $SUPER_BASE $item
done
SUPER_BASE=$BASE_URL
fi
}
look_and_co_if_trunk $1
for item in `ls` ; do pushd $item; svn update; popd; done;
@timlevett
Copy link
Author

for item in ls ; do pushd $item; for chi in ls ; do pushd $chi; svn update; popd; done; popd; done;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment