-
Notifications
You must be signed in to change notification settings - Fork 16
/
revert.sh
executable file
·64 lines (56 loc) · 1.26 KB
/
revert.sh
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
#!/bin/bash
set -e
jdk=jdk8u-dev
BUILD_DIR=`pwd`
REPO_DIR="$BUILD_DIR/$jdk"
pushd `dirname $0`
SCRIPT_DIR=`pwd`
popd
WEBREV_BASE="$BUILD_DIR/webrevs"
TOOL_DIR="$BUILD_DIR/tools"
. "$SCRIPT_DIR/tools.sh" "$TOOL_DIR" mercurial
mkdir -p "$WEBREV_BASE"
repos="jdk hotspot corba nashorn langtools jaxp jaxws"
#repos=""
# NOTE: the sed RE is very different on a mac vs Linux!
update() {
pushd "$REPO_DIR" >/dev/null
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
hg pull -u
for a in $repos ; do
cd $a
hg pull -u
cd ..
done
popd >/dev/null
}
clean() {
pushd "$REPO_DIR" >/dev/null
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
popd
}
revert() {
pushd "$REPO_DIR" >/dev/null
find "$REPO_DIR" -name \*.rej -exec rm {} \; 2>/dev/null || true
find "$REPO_DIR" -name \*.orig -exec rm {} \; 2>/dev/null || true
hg revert .
for b in `hg status | grep ^\? | cut -c 3-` ; do
echo removing $b
rm "$b"
done
for a in $repos ; do
cd $a
hg revert .
for b in `hg status | grep ^\? | cut -c 3-` ; do
echo removing $b
rm "$b"
done
cd ..
done
popd >/dev/null
}
revert
#update
#clean