unix - How to configure SVN to block certain file type? -


i have svn install in unix server. implement strategy in svn accepting file type, , error message prompt alert users. got clue done within pre-commit hook script don't know how? may know how done?

the pre-commit script script store in hooks directory under root location of svn repository (the location server uses, not location you've checked out to). can sort of script can run executable - example perl, python or bash script, correct #! line , set executable.

every time attempts commit, commit stored uncommitted transaction, script called 2 arguments - path of repo , name of transaction. script can use svn utilities such svnlook or svn log (usually option -t name_of_transaction) information transaction, , decide whether it's valid.

it produces 2 important outputs. first of exit code affect whether transaction goes ahead or not. 0 cancel transaction. eg in perl script put test decide if filename valid or not, exit(-1) if it's not. secondly if transaction rejected, written stderr displayed user explain them why commit didn't go through. before exiting non-zero code, should print @ least like:

print stderr "files extension *.exe cannot added version control"; 

try doing commit, , take @ different svn tools info commit, , should able figure out how script should work. using command-line arguments -r 555566 when know revision number of successful commit, should same using -t name in script, when name value passed in argument script.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -