forked from amooma/GS3
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsvn-diff-incremental.sh
More file actions
executable file
·52 lines (43 loc) · 907 Bytes
/
svn-diff-incremental.sh
File metadata and controls
executable file
·52 lines (43 loc) · 907 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
#
# Prints SVN log and diff incrementally between two specific
# revisions.
#
# (c) Philipp Kempgen
# GNU/GPL
USAGE="Usage: $0 <file|dir|URL> <revision> [<revision-to>]\n"
if [ -z $1 ]; then
echo -e "$USAGE" >&2
exit 1
fi
ARG_FILE=$1
if [ -z $2 ]; then
echo -e "$USAGE" >&2
exit 1
fi
ARG_REV=$2
if [ ! -z $3 ]; then
ARG_REV_FROM=$ARG_REV
ARG_REV_TO=$3
else
ARG_REV_FROM=$ARG_REV
ARG_REV_TO=$ARG_REV
fi
SVN=`which svn`
if [ -z "$SVN" ]; then
echo "svn command not found." >&2
exit 1
fi
for (( REV_TO = $ARG_REV_FROM; $REV_TO <= $ARG_REV_TO; REV_TO++ ))
do
echo ""
echo "########################################################################"
REV_FROM=$(( $REV_TO - 1 ))
$SVN log -r "${REV_TO}" "${ARG_FILE}"
[ "x$?" != "x0" ] && exit $?
echo ""
$SVN diff --notice-ancestry -r "${REV_FROM}:${REV_TO}" "${ARG_FILE}"
[ "x$?" != "x0" ] && exit $?
echo ""
echo ""
done