views:

208

answers:

3

I'd like to execute a small clientside script/exe/bat after a successful repository export from TortoiseSvn.

The process would look like:

  1. Right click repository
  2. Click TortoiseSVN Export menu item
  3. Export sucessfully completes
  4. TortoiseSVN runs my script.

I've already looked at creating a custom client hook, but they're only available for start/pre/post-commit and start/pre/post-update, whereas I need post-export.

Any ideas?

+1  A: 

I don't think this can be done in Tortoise. As you already say, there are hooks, but not for exporting.

I'd say this calls for a script or batch file. SVN has its own command line client that you could use to do the export; You could check for a successful export using ERRORLEVEL:

export.bat

@echo off
svn export xyz
IF ERRORLEVEL 1 GOTO fail
IF ERRORLEVEL 0 GOTO success

:fail
echo Fail!
GOTO end

:success
echo Success! Now calling EXE file...
call my_exe_file_here.exe
GOTO end

:end

untested but should work.

Pekka
and where do I click on that from the context menu in TortoiseSvn?
Matt Jacobsen
This is a completely Tortoise independent solution. Won't work if starting this from Tortoise is a requirement.
Pekka
Sorry, this isn't what I want. It has to be called from TortoiseSVN
Matt Jacobsen
I see. Well, it won't help you then, sorry. I'm sure however that you could add this batch file to the context menu in the registry, just as Tortoise does. It still wouldn't be in the Tortoise menu, but still in the context menu. That requires registry magic I'm not familiar with, though.
Pekka
A: 

TortoiseSVN is open source

http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk
username: guest
password: [blank]

so you could add this functionality to the source, recompile, and distribute your modified version of TortoiseSVN to your users.

Michael Hackner
yeah that's the last straw though :-)
Matt Jacobsen
Heh, someone had to say it :)
Pekka
A: 

One of the tortoiseSVN devs responded to my question on their mailing list.

http://groups.google.com/group/tortoisesvn/browse_thread/thread/e371b656f8615cf6#

Basically it currently can't be done in an integrated manner via the tortoiseSVN UI.

My solution is to have a little script that is itself in the repository. After an export through tortoiseSVN the user double clicks the script (that's also been exported to their chosen directory) and it does its magic.

Matt Jacobsen