diff options
-rwxr-xr-x | scripts/mandriva-svn2git.sh | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/scripts/mandriva-svn2git.sh b/scripts/mandriva-svn2git.sh index fe88d56..1f75bd2 100755 --- a/scripts/mandriva-svn2git.sh +++ b/scripts/mandriva-svn2git.sh @@ -2,13 +2,35 @@ # Reference: written following http://john.albin.net/git/convert-subversion-to-git SOFTWARE=$1 - if [ -z $SOFTWARE ]; then - echo "Missing software to convert..." + echo "Missing software to convert..." + exit 1 +fi +skiprevisions= +skiprevisionsx="$2" +if [ -n "$skiprevisionsx" ]; then + for rev in $skiprevisionsx; do + rev=$(echo $rev | sed 's/r//g') + rev=$(( $rev + 0 )) + if [ $rev -gt 0 ]; then + skiprevisions="$skiprevisions $rev" + fi + done fi # STEP 2: Import in git -git svn clone http://svn.mandriva.com/svn/soft/$SOFTWARE --no-metadata -A authors-transform.txt --stdlayout temp +git svn init http://svn.mandriva.com/svn/soft/$SOFTWARE --no-metadata --stdlayout temp +cd temp +revision=0 +if [ -n "$skiprevisions" ]; then + for rev in $skiprevisions; do + git svn fetch -A ../authors-transform.txt -r $(( $revision + 1 )):$(( $rev - 1 )) + revision=$rev + done +fi +git svn fetch -A ../authors-transform.txt -r $(( $revision + 1 )):HEAD +git reset --hard trunk +cd .. # STEP 3: Convert svn:ignore properties to .git ignore cd temp |