forked from silvansky/macscripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvn-changes.sh
More file actions
executable file
·34 lines (26 loc) · 812 Bytes
/
svn-changes.sh
File metadata and controls
executable file
·34 lines (26 loc) · 812 Bytes
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
#!/bin/sh
# svn-changes script by V. Silvansky <[email protected]>
# WARNING: needs diff2html.py script in /usr/local/
# you can download it at http://wiki.droids-corp.org/index.php/Diff2html
KEY=$1
DIFF_ARGS=""
DIFF2HTML=diff2html.py
DIFF2HTML_PATH=/usr/local
REPORT_PATH=/tmp/svn-changes-report-`date "+%Y-%m-%dT%H:%M:%S"`.html
if [ "$KEY" == "head" ]
then
DIFF_ARGS="-r BASE:HEAD"
elif [ "$KEY" == "-r" ]
then
DIFF_ARGS="-r BASE:$2"
fi
# echo "svn diff ${DIFF_ARGS}"
if [ ! -e ${DIFF2HTML_PATH}/${DIFF2HTML} ]
then
echo "${DIFF2HTML} not found! It must be placed in ${DIFF2HTML_PATH}"
exit 1
fi
svn diff ${DIFF_ARGS} | python ${DIFF2HTML_PATH}/${DIFF2HTML} > ${REPORT_PATH}
FSIZE=`stat -f "%z" ${REPORT_PATH}`
echo "Report file ${REPORT_PATH} created! File size is $FSIZE"
open ${REPORT_PATH}