#!/bin/sh SVNLOOK=/usr/bin/svnlook PROHIBIT=0 REPOS="$1" TXN="$2" # Don't accept commits with term "PROHIBIT-CHECKIN" in a changed line. $SVNLOOK diff -t "$TXN" "$REPOS" | grep -E "^[-\+].*?PROHIBIT-CHECKIN" 2>/dev/null && PROHIBIT=1 # If the commit message contains "ALLOW-CHECKIN" remove the # PROHIBIT-flag and let the checkin pass. $SVNLOOK log -t "$TXN" "$REPOS" | grep "ALLOW-CHECKIN" 2>/dev/null && PROHIBIT=0 # Test if the PROHIBIT-flag is set and act. if [ "$PROHIBIT" = "1" ]; then echo "\nTried to commit a line which was tagged with: PROHIBIT-CHECKIN.\n" >&2 exit 1 fi # All checks passed, so allow the commit. exit 0