]> source.dussan.org Git - vaadin-framework.git/commitdiff
Scripts for easing merge from 6.7
authorArtur Signell <artur.signell@itmill.com>
Fri, 27 Jan 2012 08:28:24 +0000 (08:28 +0000)
committerArtur Signell <artur.signell@itmill.com>
Fri, 27 Jan 2012 08:28:24 +0000 (08:28 +0000)
svn changeset:22783/svn branch:6.8

scripts/merge-all.sh [new file with mode: 0755]
scripts/merge.sh [new file with mode: 0755]

diff --git a/scripts/merge-all.sh b/scripts/merge-all.sh
new file mode 100755 (executable)
index 0000000..74502a0
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/bash
+FROM=$1
+AUTOMERGE=$2
+if [ "$FROM" = "" ]
+then
+       echo "Usage: $0 <from version> [automerge]"
+       exit
+fi
+if [ "$AUTOMERGE" = "automerge" ]
+then
+       AUTOCOMMIT="autocommit"
+fi
+
+svn up
+localchanges=`svn stat|wc -l`
+if [ "$localchanges" != "0" ] && [ "$IGNOREDIRTY" != "ignoredirty" ]
+then
+       echo "You must have a clean working space copy"
+       exit
+fi
+
+currentrepowithoutversion=`svn info|grep URL|sed "s/URL: //"|sed "s/\/[^\/]*$//"`
+
+sourceurl="$currentrepowithoutversion/$FROM"
+
+if [ "$unmerged" = "" ]
+then
+       echo "No changes to merge"
+       exit 0
+fi
+echo "Unmerged changes"
+echo "================"
+for revision in $unmerged
+do
+       echo -n "[$revision] "
+       svn log $sourceurl -r $revision --xml|grep "<msg>"|sed "s/<msg>//"|sed "s/<\/msg>//"
+done
+
+cmd=""
+for revision in $unmerged
+do
+       thiscmd=`dirname $0`"/merge.sh $FROM $revision $AUTOCOMMIT $IGNOREDIRTY"
+       cmd="$thiscmd && "
+       if [ "$AUTOMERGE" = "automerge" ]
+       then
+               echo "Merging [$revision]..."
+               $thiscmd
+               if [ "$?" != "0" ]
+               then
+                       echo "Merge of [$revision] failed, aborting..."
+                       exit 1
+               fi
+       fi
+done
+cmd="$cmd true"
+if [ "$AUTOMERGE" != "automerge" ]
+then
+       echo
+       echo "Merge command:"
+       echo 
+       echo $cmd
+fi
+
diff --git a/scripts/merge.sh b/scripts/merge.sh
new file mode 100755 (executable)
index 0000000..775bc6a
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+FROM=$1
+REVISION=$2
+AUTOCOMMIT=$3
+
+if [ "$FROM" = "" ] || [ "$REVISION" = "" ]
+then
+       echo "Usage: $0 <from version> <changeset> [autocommit]"
+       exit 2
+fi
+
+localchanges=`svn stat|wc -l`
+if [ "$localchanges" != "0" ]
+then
+       echo "You must have a clean working space copy"
+       exit 2
+fi
+
+svn up
+
+msg=`svn log http://dev.vaadin.com/svn/versions/$FROM -r $REVISION --xml|grep "<msg>"|sed "s/<msg>//"|sed "s/<\/msg>//"`
+svn merge http://dev.vaadin.com/svn/versions/$FROM . -c $REVISION
+msg="[merge from $FROM] $msg"
+if [ "$AUTOCOMMIT" = "autocommit" ]
+then
+       echo "Trying to commit..."
+       svn commit -m "$msg"
+       RET=$?
+       if [ "$RET" != "0" ]
+       then
+               exit 1
+       fi
+       exit 0
+else
+       echo "Run the following command to commit..."
+       echo svn commit -m \"$msg\"
+       exit 1
+fi
+