summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2013-08-20 10:40:00 +0100
committerColin Guthrie <colin@mageia.org>2013-08-20 10:40:00 +0100
commit84d9d98c611932b085de07c87a6968430908b912 (patch)
tree164d3e326152aab0d5e04dbb1b90c48e7bc7fed7
parentb2c30d63561a7b69136b6091468340b54425b43e (diff)
downloadsvn-git-migration-84d9d98c611932b085de07c87a6968430908b912.tar
svn-git-migration-84d9d98c611932b085de07c87a6968430908b912.tar.gz
svn-git-migration-84d9d98c611932b085de07c87a6968430908b912.tar.bz2
svn-git-migration-84d9d98c611932b085de07c87a6968430908b912.tar.xz
svn-git-migration-84d9d98c611932b085de07c87a6968430908b912.zip
Fix for sub paths in SVN names
-rwxr-xr-xscripts/mageia-import.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/mageia-import.sh b/scripts/mageia-import.sh
index dc49f4b..048ea63 100755
--- a/scripts/mageia-import.sh
+++ b/scripts/mageia-import.sh
@@ -8,14 +8,15 @@ if [ -z $SOFTWARE ]; then
echo "Missing software to convert..."
exit 1
fi
+BASESOFTWARE=$(basename $SOFTWARE)
-if [ -d $SOFTWARE-origin ]; then
- echo "It seems the svn-git repository already exists ($SOFTWARE-origin)"
+if [ -d $BASESOFTWARE-origin ]; then
+ echo "It seems the svn-git repository already exists ($BASESOFTWARE-origin)"
exit 1
fi
-if [ -d $SOFTWARE.git ]; then
- echo "It seems the converted git repository already exists ($SOFTWARE.git)"
+if [ -d $BASESOFTWARE.git ]; then
+ echo "It seems the converted git repository already exists ($BASESOFTWARE.git)"
exit 1
fi
@@ -35,8 +36,8 @@ echo "Identified software name: $SOFTWARE"
echo "SVN Revisions to skip: $skiprevisions"
echo
-git svn init $NEWSVNURL/$SOFTWARE --no-metadata --stdlayout $SOFTWARE-origin
-cd $SOFTWARE-origin
+git svn init $NEWSVNURL/$SOFTWARE --no-metadata --stdlayout $BASESOFTWARE-origin
+cd $BASESOFTWARE-origin
revision=0
if [ -n "$skiprevisions" ]; then
for rev in $skiprevisions; do
@@ -52,13 +53,13 @@ echo "done"
echo
echo "Now creating bare git repository"
-git init --bare ../$SOFTWARE.git
+git init --bare ../$BASESOFTWARE.git
git remote rm origin
-git remote add origin ../$SOFTWARE.git
+git remote add origin ../$BASESOFTWARE.git
#git push --set-upstream master
git push origin master 'refs/remotes/*:refs/heads/*'
-pushd ../$SOFTWARE.git
+pushd ../$BASESOFTWARE.git
git branch -D trunk
git branch -D origin/master 2>/dev/null
@@ -199,7 +200,7 @@ parsesvnrevmap()
echo
echo -n "Creating revision -> sha1 map SQL... "
-sql="../$SOFTWARE-revmap.sql"
+sql="../$BASESOFTWARE-revmap.sql"
rm -f "$sql" "$sql".xz
# Mageia commits