summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-06-12 12:00:07 +0100
committerColin Guthrie <colin@mageia.org>2013-06-12 12:00:07 +0100
commit98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44 (patch)
tree8f54d491b9aa11978e527198a082dd98637024fd /scripts
parent3a832348a36065f1b3c380b8d5ab52e21be6d988 (diff)
downloadsvn-git-migration-98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44.tar
svn-git-migration-98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44.tar.gz
svn-git-migration-98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44.tar.bz2
svn-git-migration-98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44.tar.xz
svn-git-migration-98c2ddf1e9bfa5c3b084ad5e5111e5443fd65d44.zip
Add the ability to skip revisions in the mandriva import script.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mandriva-svn2git.sh28
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