[Pkg-ocaml-maint-commits] r5326 - /trunk/tools/svn2git/svn2git_alioth

zack at users.alioth.debian.org zack at users.alioth.debian.org
Mon Mar 17 11:11:40 UTC 2008


Author: zack
Date: Mon Mar 17 11:11:40 2008
New Revision: 5326

URL: http://svn.debian.org/wsvn/?sc=1&rev=5326
Log:
add support for "localizing" remote tracked branches

Modified:
    trunk/tools/svn2git/svn2git_alioth

Modified: trunk/tools/svn2git/svn2git_alioth
URL: http://svn.debian.org/wsvn/trunk/tools/svn2git/svn2git_alioth?rev=5326&op=diff
==============================================================================
--- trunk/tools/svn2git/svn2git_alioth (original)
+++ trunk/tools/svn2git/svn2git_alioth Mon Mar 17 11:11:40 2008
@@ -47,18 +47,29 @@
 gitsvn_fetch () {
   info " checking in svn history into git"
   (cd "$wdir"
-  git-svn fetch)
+  git-svn fetch --fetch-all)
 }
 
-fix_tags () {
+fix_branches () {
   info " converting tag \"branches\" to git tags"
   (cd "$wdir"
   tag_branches=$(git branch -r | awk '{ print $1 }' | grep "^tags/")
   for branch in $tag_branches ; do
     version=$(echo $branch | cut -f 2 -d /)
     info "* (git-)tagging version $version"
-    git tag $version $branch^	# tag branch parent
-    git branch -r -d $branch	# delete branch
+    last_parent="$(git cat-file commit $branch | grep ^parent | tail -n 1 | cut -f 2 -d' ')"
+    git tag $version $last_parent # tag branch parent
+    git branch -r -d $branch	  # delete branch
+  done)
+
+  info " \"localizing\" remote branches"
+  (cd "$wdir"
+  remote_branches=$(git branch -r | awk '{ print $1 }')
+  for branch in $remote_branches ; do
+    if [ "$branch" != "trunk" ] ; then
+      git branch --track $branch $branch
+    fi
+    git branch -r -d $branch
   done)
 }
 
@@ -78,7 +89,11 @@
 
 [ -z "$NO_INIT" ] && git_svninit
 [ -z "$NO_FETCH" ] && gitsvn_fetch
-[ -z "$NO_TAGFIX" ] && fix_tags
-[ -z "$NO_CLEAN" ] && clean_repo
+[ -z "$NO_BRANCHFIX" ] && fix_branches
+if [ -z "$NO_CLEAN" ] ; then
+  clean_repo
+else
+  mv $wdir "$DESTDIR"
+fi
 info " all done, see ya."
 




More information about the Pkg-ocaml-maint-commits mailing list