forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam-repo
116 lines (97 loc) · 3.22 KB
/
team-repo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
if [ -z $repository && -n $1 ]; then
repository = $1
fi
if [ -z $action && -n $2]; then
action = $2
fi
if [ -z $push_username && -n $3 ]; then
push_username = $3
fi
if [ -z $push_password && -n $4 ]; then
push_password = $4
fi
[ "$action" = "build" ] || [ "$action" = "sync" ] || exit 101
[ -n "$push_username" ] || exit 102
[ -n "$push_password" ] || exit 103
[ -n "$repository" ] || exit 104
ANT_OPTS="-Xmx512m"
export ANT_OPTS
HGMERGE=merge
export HGMERGE
rm -rf real.workspace
hg clone . real.workspace || exit 1
cd real.workspace
testmodule() {
ant -f $1/build.xml test -Dtest-unit-sys-prop.ignore.random.failures=true
}
if [ "$action" = "build" ]; then
# hg fetch http://hg.netbeans.org/main || exit 1
# hg pull http://hg.netbeans.org/main || exit 1
# if [ `hg heads --template '{node|short}\n' | wc -l` = 1 ]
# then
# hg up || exit 6
# else
# hg merge || exit 7
# hg ci -m 'Automated merge' || exit 8
# fi
ant build || exit 2
ant commit-validation # || exit 3
testmodule openide.util || exit 4
testmodule openide.modules || exit 4
testmodule openide.filesystems || exit 4
# masterfs is currently broken, Radek wants me to disable it until 6.1M2:
# ant -f masterfs|| exit 4
testmodule openide.nodes|| exit 4
testmodule openide.options || exit 4
testmodule openide.dialogs || exit 4
testmodule openide.awt || exit 4
testmodule openide.windows || exit 4
testmodule core.startup # || exit 4
# testmodule openide.io || exit 4
if [ `hg out --template '{node|short}\n' http://hg.netbeans.org/main | wc -l` > 0 ]; then
echo No outgoing changes
# exit 0
fi
for i in 1 2 3; do
hg pull http://hg.netbeans.org/main || exit 5
if [ `hg heads --template '{node|short}\n' | wc -l` = 1 ]
then
hg up || exit 6
else
hg merge || exit 7
hg ci -m 'Automated merge' || exit 8
fi
hg out http://hg.netbeans.org/main
hg in http://hg.netbeans.org/main
hg push https://"$push_username":"$push_password"@hg.netbeans.org/main && exit 0
done
exit 5
fi
if [ "$action" = "sync" ]; then
HEADS=`hg heads --template "{node}\n" | wc -l`
if [ $HEADS = 2 ]; then
hg merge
hg ci -m "Automated merge"
hg up -C
fi
hg fetch http://hg.netbeans.org/$repository
hg push https://"$push_username":"$push_password"@hg.netbeans.org/$repository
exit 0
fi