forked from mono/monodevelop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvnci
executable file
·54 lines (41 loc) · 838 Bytes
/
svnci
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
#! /bin/bash
FILES=$@
echo "Creating commit message..."
MSG=`mktemp`
svn di $FILES | filterdiff -i'*ChangeLog' |
sed -e '/^[^+]/d' -e 's,^[+],,' -e '/^[^+]/b' -e 's,^[+][+],In,' -e 's,/ChangeLog.*$,:,' -e 's,ChangeLog.*$,.:,' >> $MSG
case `grep '^In' $MSG | wc -l` in
1) (echo 1d; echo w; echo q) | ed - $MSG ;;
*) ;;
esac
cat $MSG
echo About to commit
svn st $FILES
while [[ 1 ]]
do
read -a RESPONSE -p"Would you like to continue (Y)es/(N)o/(E)dit Message: "
if [[ $? != 0 ]]
then
RESPONSE="N"
fi
case $RESPONSE in
"Y" | "y" | "yes" | "Yes")
echo "Comitting..."
svn ci -F $MSG $FILES
rm $MSG
exit 0
;;
"N" | "n" | "no" | "No")
echo "Aborting..."
rm $MSG
exit 1
;;
"E" | "e" | "ed" | "Ed" | "Edit" | "edit")
vi $MSG
# try again
;;
*)
# try again
;;
esac
done