My trunk has structure:
\trunk
----\data
----\src
----\tool
with \tool
is external to another place, not in my trunk
. So i开发者_如何学Python don't want user commit to \tool
in SVN. They can only commit to \data
or \src
.
Can anybody help me to create a hook script to prevent user commit to external (in this case is \tool
folder)?
I'm not very familiar with externals, but if you do want to create a pre-commit hook script, it's pretty easy code but tricky to debug.
Your pre-commit hook takes in two parameters, $ARGV[0] = repository path, $ARGV[1] = transaction being committed.
Your hook script would use svnlook, something like
svnlook dirs-changed -r $ARGV[0] -t $ARGV[1]
And return a (negative?) exit status if svnlook returned that tools (or anything starting with tools) changed.
Anything you print to STDERR is displayed to client as the error message.
You would place this script in your repository under hooks, name it "pre-commit", make it executable
Be sure to check the svnlook documentation as I'm going on memory here
精彩评论