1
#!/bin/bash
2
3
stagingBranch=$1
4
if [ -z "$stagingBranch" ]; then
5
    stagingBranch=4.6
6
fi
7
8
git checkout qtwebkit-$stagingBranch-staging
9
if [ $? != 0 ]; then
10
    echo "could not switch to staging branch"
11
    exit 1
12
fi
13
14
branch=git-svn
15
git rev-parse --verify -q $branch >/dev/null
16
if [ $? != 0 ]; then
17
    branch=origin/svn/master
18
fi
19
20
echo "resetting to $branch"
21
22
git reset --hard $branch
23
24
for branch in `git branch -r | grep origin | grep staging/$stagingBranch`; do
25
    remote=`echo $branch | sed -e "s,/.*,,"`
26
    branch=`echo $branch | sed -e "s,$remote/,,"`
27
    echo "merging $branch"
28
    git pull --no-ff $remote $branch
29
    if [ $? != 0 ]; then
30
        echo "merge failed. trying my luck with resolve-ChangeLogs"
31
        (WebKitTools/Scripts/resolve-ChangeLogs && git commit) || exit 1
32
    fi
33
done