]> git.saurik.com Git - wxWidgets.git/blob - misc/scripts/svn/hooks/pre-commit
Add the initial version of svn pre-commit hook.
[wxWidgets.git] / misc / scripts / svn / hooks / pre-commit
1 #!/bin/sh
2
3 REPOS="$1"
4 TXN="$2"
5
6 SVNLOOK=/usr/bin/svnlook
7
8 changed_cpp_files=`$SVNLOOK changed "$REPOS" -t "$TXN" | \
9 grep "^[AU]" | \
10 sed 's/^....//' | \
11 egrep "\.(cpp|h|py)$" | \
12 egrep -v "src/(tiff|regex|jpeg|stc/scintilla)" `
13
14 rc=0
15
16 set -e
17 for f in $changed_cpp_files; do
18 if $SVNLOOK cat "$REPOS" -t "$TXN" $f | fgrep -q ' '; then
19 echo "Please remove TABs from $f before committing." >&2
20 rc=1
21 fi
22 done
23
24 exit $rc