-
Notifications
You must be signed in to change notification settings - Fork 2
/
mfc-svn
executable file
·64 lines (49 loc) · 1.1 KB
/
mfc-svn
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/sh
err()
{
echo "$(basename $0): $1"
exit 1
}
usage()
{
echo "usage: $(basename $0) [<rev> | <rev1>,<rev2>,... | <rev1>-<rev2>" >&2
exit 1
}
TAGS="admbugs PR"
test -d ../../.svn || err "are you in the root of a stable branch?"
test -x $(which $EDITOR) || err "set EDITOR"
set -e
log=$(mktemp)
#IFS=','
for rev in $1; do
test -z "$(svn status)" || err "unclean branch"
svn up
svn merge -c $rev ^/head .
revlist=
oldifs=$IFS
IFS=','
for _rev in $rev; do
if [ -z "$revlist" ]; then
sep=""
else
sep=", "
fi
revlist="${revlist}${sep}r${_rev#r}"
done
IFS=$oldifs
echo "MFC ${revlist}:" >> $log
svn log -c $rev ^/head | sed -n -e 4p >> $log
for tag in $TAGS; do
line=$(svn log -c $rev ^/head | grep '^'$tag':' || true)
if [ -n "$line" ]; then
echo >> $log
echo "$line" >> $log
fi
done
$EDITOR $log
# Trigger an abort if the log file was truncated.
grep -q '^MFC' $log
svn commit -F $log
truncate -s 0 $log
done
rm -f $log