Thanks for the help, I may be misunderstanding but is %REPOROOT% going to be the svn repository for my team or is it going to be my local working copy? I haven't committed the batch files or hook script files yet, they've just been in my working directory as I don't want to mess up the entire teams work while working on this. I thought %REPOROOT% would be the trunk of my local working directory.
/hooks/script.bat (this is a hook script containing `exit 0`)/branch/ (this is a branch of `/trunk`)file.txt/branches//test/ (this is a branch of `/trunk` too)file.txt/trunk/file.txtD:\TEST\wc, but we have a sparse checkout so it looks like this:\hooks\script.bat\trunk\file.txttsvn:startcommithook = start_commit_hook %REPOROOT%/hooks/script.bat true show.\trunk\file.txt; the hook approve/reject dialog shows the path D:\TEST\wc\hooks\script.bat and the script runs as expected upon approval.\trunk to the directory \branch in the repository.\trunk\file.txt; the hook dialog again shows the path D:\TEST\wc\hooks\script.bat and the script runs normally.\trunk to the directory \branches\test in the repository.\trunk\file.txt; the hook dialog now shows the path D:\TEST\hooks\script.bat (note the missing wc), the script does not run and an error message appears: The hook script returned an error. The system cannot find the file specified. (the message is a bit misleading, because the script does actually not run, so it cannot return an error, also because its content is only exit 0)./trunk) and switched paths (/branches/test) seem to derogate proper expansion of the
placeholder %REPOROOT%.tsvn:startcommithook property recursively.%REPOROOT% to %REPOROOT+% and commit something to the not switched local path \trunk, not even the approve/reject dialog appears, which lets me suspect that the hook script is not running at all.%REPOROOT% should now work as expected, I have done some experiments with %REPOROOT+%. Here are the results, sticking to the aforementioned example, hence having the same repository and working copy structures:tsvn:startcommithook = start_commit_hook %REPOROOT+%/hooks/script.bat true show.\trunk\file.txt; the hook approve/reject dialog does not appear, so the script does not run and the Commit Dialog shows up immediately.\trunk to the directory \branch in the repository.\trunk\file.txt; the hook approve/reject dialog does not appear, so the script does not run and the Commit Dialog shows up immediately.\trunk to the directory \branches\test in the repository.\trunk\file.txt; the hook approve/reject dialog appears now and shows the path D:\TEST\wc\hooks\script.bat, the script runs as expected upon approval.\trunk back to the directory \trunk in the repository.tsvn:startcommithook changed to start_commit_hook %REPOROOT+%/script.bat true show (with top-level folder /hooks removed), the hook approve/reject dialog does never appear.%REPOROOT+%: this should find any missing top-level folders between the WC root and the remaining relative path, right?%REPOROOT+%/script.bat should be enough to find the script, correct?/hooks here), or should %REPOROOT+%/hooks/script.bat also find the script?)%REPOROOT% or %REPOROOT+% is used to specify the hook script path, only forward slashes are accepted…(Just to make sure I don't misunderstand%REPOROOT+%: this should find any missing top-level folders between the WC root and the remaining relative path, right?So in the above example, specifying%REPOROOT+%/script.batshould be enough to find the script, correct?Do I have to skip at least one top-level folder (like/hookshere), or should%REPOROOT+%/hooks/script.batalso find the script?)
%REPOROOT+%/hooks/script.batand your working copy is at /trunk the script is found normally.But if you switch your working copy to e.g. branches/mybranch, the "+" indicates that both branches/mybranch and branches are tried to find the script.