Subversion/Pre-commit prevent changes to directory

From Sidvind
Jump to: navigation, search

Code: pre-commit (view, download)

  1. #!/bin/sh
  2.  
  3. set -e
  4. set -o pipefail
  5.  
  6. REPOS="$1"
  7. TXN="$2"
  8.  
  9. if svnlook dirs-changed -t "${TXN}" "${REPOS}" | grep "^PATH/TO/BLOCK"; then
  10.   echo "Message to display" > 1>&2
  11.   exit 1
  12. fi

Put in /path/to/repo/hooks and chmod +x