Created
October 5, 2018 14:45
-
-
Save codicesoftware/e97d7019eee00f7ec84bde50247ee269 to your computer and use it in GitHub Desktop.
Windows script to migrate your SVN repos to Plastic SCM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svnrepo=https://SVNSERVER/svn/REPO | |
plasticserver=PLASTICSERVER:PORT | |
for project in `svn ls $svnrepo`; do | |
project=${project%/} # strip final slash | |
echo Processing project $project... | |
echo --------------------------------------------------- | |
# check if repo already exists at Plastic server | |
grepcount=`cm lrep | grep -c $project`; | |
if [ "$grepcount" == "0" ]; then | |
git svn clone $svnrepo/$project --stdlayout | |
cd $project | |
git fast-export --all -C --tag-of-filtered-object=drop --signed-tags=strip > repo.fe | |
cm mkrep $project@$plasticserver | |
cm rnbr /main@$project@$plasticserver master | |
cm fi $project@$plasticserver repo.fe | |
cm rnbr /master@$project@$plasticserver main | |
cd .. | |
else | |
echo Project already exists in Plastic SCM server | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment