Yo, svn users!
Say we have a workspace with lots of svn projects. And workspace is related to the project via svn:externals property.
Here is a nice short script that saves a lot of time performing svn update in parallel:
script description:
Say we have a workspace with lots of svn projects. And workspace is related to the project via svn:externals property.
Here is a nice short script that saves a lot of time performing svn update in parallel:
#!/bin/bashset -xif [ -z "$1" ]thenSVN_REV=""elseSVN_REV="-r $1 "fisvn up --ignore-externals ${SVN_REV} .svn pg svn:externals . | \grep -v "^$" | \sed -e "s/\^//g" | \awk '{ print "svn co https://my_repo.com"$1" "$2 }' | \sed -e 's/$/ \&/g' \> _svn_up_parallelcat _svn_up_parallelbash _svn_up_parallelrm _svn_up_parallel
script description:
grep -v "^$" - removes empty strings from svn:externals
sed -e "s/\^//g" - removes ^ from lines
awk '{ print "svn co https://my_repo.com"$1" "$2 }' - converts record from
"/my_project1/trunk my_project1" to "https://my_repo.com/my_project1/trunk my_project1"
sed -e 's/$/ \&/g' - inserts a " &" at the end of each line to send the command to background
No comments:
Post a Comment