2008-09-25 19:20:04 +00:00
|
|
|
#!/bin/sh
|
2008-09-25 11:17:08 +00:00
|
|
|
# Copyright: 2008, Nick Treleaven
|
|
|
|
# License: GNU GPL V2 or later
|
|
|
|
# Warranty: NONE
|
2008-09-23 14:46:42 +00:00
|
|
|
|
|
|
|
# Displays a summary of Subversion working copy changes in ChangeLog
|
|
|
|
# format, plus warnings about any unknown files.
|
|
|
|
|
|
|
|
# -s for spaces instead of comma separation
|
2008-09-25 19:20:04 +00:00
|
|
|
if [ "$1" = -s ]; then
|
2008-09-23 14:46:42 +00:00
|
|
|
SPACES="set"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2008-12-09 12:38:00 +00:00
|
|
|
# -q to not print warnings
|
|
|
|
if [ "$1" = -q ]; then
|
|
|
|
QUIET="set"
|
|
|
|
shift
|
|
|
|
fi
|
|
|
|
|
2008-09-23 14:46:42 +00:00
|
|
|
status=`svn st $*`
|
|
|
|
|
|
|
|
# get list of files changed.
|
|
|
|
# remove extraneous text, e.g. ? entries
|
|
|
|
files=`echo "$status" |egrep '^[A-Z]'`
|
|
|
|
# get filenames on one line
|
|
|
|
files=`echo "$files" |egrep -o '[^A-Z].[ ]+(.+)' |xargs`
|
2010-10-06 16:06:13 +00:00
|
|
|
# remove ChangeLog
|
|
|
|
files=`echo "$files" |sed "s/ ChangeLog\b//"`
|
2008-09-23 14:46:42 +00:00
|
|
|
# add commas if -s argument is not given
|
2008-09-25 19:20:04 +00:00
|
|
|
if [ -z "$SPACES" ]; then
|
2008-09-23 14:46:42 +00:00
|
|
|
files=`echo "$files" |sed "s/ /, /g"`
|
|
|
|
fi
|
|
|
|
|
|
|
|
# show modifications
|
2008-09-25 19:20:04 +00:00
|
|
|
if [ -n "$files" ]; then
|
2008-09-23 14:46:42 +00:00
|
|
|
echo 'Changes:'
|
2008-10-02 16:10:45 +00:00
|
|
|
if [ -z $SPACES ]; then
|
|
|
|
files="${files}:"
|
2008-09-23 14:46:42 +00:00
|
|
|
fi
|
|
|
|
# indent and wrap
|
|
|
|
OUTFILE=/tmp/fmt
|
|
|
|
echo -n ' '$files | fmt -w 72 >$OUTFILE
|
|
|
|
# put ' * ' for first line
|
|
|
|
cat $OUTFILE | sed '1s/ / * /'
|
|
|
|
else
|
|
|
|
echo 'No changes.'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# warn about anything that isn't a modification or addition
|
2008-12-09 12:38:00 +00:00
|
|
|
if [ -n "$QUIET" ]; then
|
|
|
|
exit
|
|
|
|
fi
|
2008-09-23 14:46:42 +00:00
|
|
|
warn=`echo "$status" |egrep '^[^MA]'`
|
2008-09-25 19:20:04 +00:00
|
|
|
if [ -n "$warn" ]; then
|
2008-09-23 14:46:42 +00:00
|
|
|
echo 'Warnings:'
|
|
|
|
echo $warn
|
|
|
|
else
|
|
|
|
echo 'No warnings.'
|
|
|
|
fi
|