Index: svnadmin/hooks/scripts/detect-empty.sh =================================================================== --- svnadmin/hooks/scripts/detect-empty.sh +++ svnadmin/hooks/scripts/detect-empty.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +REPO=$1 +TXN=$2 + +OIFS=${IFS} +IFS=$'\n' +svnlook log -t "${TXN}" "${REPO}" | grep -q portmgr && exit 0 +for line in $(svnlook changed -t $TXN $REPO) ; do + IFS=${OIFS} + set -- $line + type=$1 + fpath=$2 + case $type in + [^AU]*) continue;; + esac + if [ `svnlook cat -t ${TXN} ${REPO} $fpath | wc -c` -eq 0 ]; then + echo "Some files in your commit are empty: $fpath" 1>&2 + echo "Please fix this and try committing again." 1>&2 + exit 1 + fi +done