Oded
Oded

Reputation: 795

SVN post-commit hook not executing file

I have created an exe file that will print to console the first and second arguments that it receives.

In the SVN post-commit hook I wrote:

PATH_TO_FILE\print.exe "%1" "%2"

when I make a check-in, it gets stuck.

%1 is the PATH
%2 is revision number

EDIT

The answer to my question is that the executable file should be in the "bin" directory of the SVN Server, not in the hooks folder of the repository.

Thank you all, Oded.

Upvotes: 5

Views: 1675

Answers (3)

publicRavi
publicRavi

Reputation: 2763

It must be Windows environment since I see print.exe. I simply echo the arguments like below.

echo %1 %2 >&2

This seems to print to the command prompt without issues.

Upvotes: 0

Peter Lindqvist
Peter Lindqvist

Reputation: 10200

Print takes a filename to put on the printer. You are supplying a directory i assume of your description. Try writing something to a file.

echo "%1" "%2" > c:\temp\log.txt

Upvotes: 1

Simon P Stevens
Simon P Stevens

Reputation: 27499

What OS are we talking about? If it's Windows I don't think you should have the quotes (") around the parameters.

What is "PATH_TO_FILE"? And environment variable? What is it's value? Have you checked that it doesn't include a final backslash? Have you restarted after changing the environment variable. Is it a system wide or user level environment variable. Remember that if you are running the SVN server as a service it's under a different user so the env var might not be defined for that user. Why don't you just put the full path in directly for now just to test it's nothing to do with an incorrect environment variable.

You say "it gets stuck" do you get an error? What happens exactly? Some more details of how it fails might help.

If this is Windows you are using, you can redirect any errors to a file by doing this:

PATH_TO_FILE\print.exe %1 %2 > c:\output.txt

Is this a plain SVN server or are you using visualSVN Server?

Upvotes: 0

Related Questions