views:

148

answers:

3

Hi,

I've set up BugId property to my files in the repository. This means that on the commit window, I have a field which the developers type the issue number of the bug and it's shown in the log message of the commit.

I wanted to know if there a possibility that once I click on the commit button, before the commit itself, an exe file will be executed.

I'm not referring to the pre-commit hook, as it runs after I click on the commit button.

Thanks.

+1  A: 

If you want this file to run on your client check the TortoiseSVN help 4.30.8. Client Side Hook Scripts.

There is a Start-commit hook for TortoiseSVN that runs just before the commit dialog is shown.

I have just tried this and it works just fine.

alt text

File test.bat contains only exit 0 command and I can clearly see the console window opening and closing before the commit dialog is shown.

Nikola Smiljanić
I'm looking for a way to execute my exe/bat file BEFORE the user presses the commit button. I'm familiar with all the SVN hooks.
Oded
I tried the start-commit hook. It executes after the commit button is pressed.
Oded
Thank you, I tried one more time and I got it. it works fine.
Oded
A: 

In TortoiseSVN 1.5 and up, you can define Client-Side Hook Scripts. Read about them in the excellent TortoiseSVN help system. In particular, for your purposes, look at the Start-Commit and Pre-Commit hooks.

Avi
although the Start-Commit supposed to be executed before the commit dialog opens, it doesn't. The hook is executed after I press the commit button.
Oded
@Oded: I'm not sure what you mean by the "commit button". TortoiseSVN, as I know it, has a "Commit" menu item, which if triggered brings up the Commit dialog box, which has an "Ok" button. The Start-Commit hook runs before the dialog opens - see http://stackoverflow.com/questions/59007/how-do-i-use-a-start-commit-hook-in-tortoisesvn-to-setup-a-custom-log-entry/59379 for an exmple usage.
Avi
I ment the "OK" button. I've created a batch file that only creates a simple text file and put in in the start-commit hook. it still doesn't launch the batch file until I press the OK button.Any ideas?
Oded
I'm not sure, other than looking carefully into the accepted answer on the other question about the API: http://stackoverflow.com/questions/59007/how-do-i-use-a-start-commit-hook-in-tortoisesvn-to-setup-a-custom-log-entry/59349#59349
Avi
A: 

You should consider implementing an IBugtraqProvider. That interface was specifically designed for this purpose.

You might want to use the CheckCommit() method.

Stefan