]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/commitdiff
Added script for updating frescor-svn branch
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 19 Oct 2009 11:04:30 +0000 (13:04 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 19 Oct 2009 11:04:30 +0000 (13:04 +0200)
src/update-frescor-svn [new file with mode: 0755]

diff --git a/src/update-frescor-svn b/src/update-frescor-svn
new file mode 100755 (executable)
index 0000000..bb2167f
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Script to track FRESCOR SVN repositories. We do this in order not to
+# diverge to much from the original code so that it can be easily
+# joined in future if it will be necessary.
+
+set -e
+
+update() {
+    local dir=$1
+    local svnrepo=$2
+    cd $dir
+    echo "Updating $dir"
+    if ! git config --get  svn-remote.svn.url > /dev/null; then
+       git svn init $svnrepo
+    fi
+
+    git svn fetch
+    local gitbranch=`git show-ref --verify --hash refs/heads/frescor-svn`
+    local svnbranch=`git show-ref --verify --hash refs/remotes/git-svn`
+    
+    if [ -z "$gitbranch" ]; then
+       echo "  Creating frescor-svn branch"
+       git branch frescor-svn git-svn
+    else
+       if [ "$gitbranch" != "$svnbranch" ]; then
+           echo "  Merging SVN to branch frescor-svn"
+           git merge git-svn
+           git checkout master
+       else
+           echo "  Already up-to-date"
+       fi
+    fi
+    cd ..
+}
+
+update frsh-include http://www.frescor.org/private/svn/frescor/frsh/trunk/include
+update fosa        http://www.frescor.org/private/svn/frescor/fosa/trunk
+update fna         http://www.frescor.org/private/svn/frescor/fna/trunk