#!/bin/sh
#
# This is a small utility that updates the ChangeLog based on the svn status.
#
# Vi is started and the change content is merged at the top of the file.
#

TMPFILE="/tmp/ChangeLogEntry_$$"

{
  echo "`date '+%Y-%m-%d'`  `cat .developer`"
  echo "" 

  svn status | sort | \
  while read O FILE; do
    case "$O" in
     A)  echo $FILE | if read H F; then
           test -z "$F" \
             && echo "        * $FILE: New file." \
             || echo "        * $F: Moved from "
         fi
         ;;
     D)  echo "        * $FILE: Removed."
         ;;
     M)  echo "        * $FILE:"
         ;;
     ?)  # pass
         ;;
     X)  # external repository
         ;;
    esac
  done
  echo ""
} > $TMPFILE

vi -c "r $TMPFILE" ChangeLog
