SVN_MODULE=$(basename $arg)
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx converting module $SVN_MODULE in $(pwd)"
SVN_PATH=${SVNROOT}/${SVN_MODULE}
- GIT_REPO=$(echo $SVN_MODULE | sed 's/.*/\L&/')
-
-# rm -rf $TMPDIR
-# mkdir -p $TMPDIR
-# pushd $TMPDIR
-# git svn init -s $SVN_PATH --no-metadata
-# git svn fetch
-# popd
-
- rm -rf $GIT_REPO
- mkdir -p $GIT_REPO
- pushd $GIT_REPO
+ GIT_WORKDIR=$(echo $SVN_MODULE | sed 's/.*/\L&/')
+ GIT_REPO=${GIT_WORKDIR}.git
+
+ rm -rf $GIT_WORKDIR
+ rm -rf $GIT_REPO
+
+ mkdir -p $GIT_WORKDIR
+ pushd $GIT_WORKDIR
svn2git $SVN_PATH
popd
+
+ mv ${GIT_WORKDIR}/.git ${GIT_REPO}
+ rm -rf ${GIT_WORKDIR}
+
+ pushd $GIT_REPO
+ # enable clone with git:// protocol
+ # git-config daemon.uploadpack true
+
+ # enable archive with git:// procotol
+ git-config daemon.uploadarchive true
+ popd
+
done
}