views:

149

answers:

1

Hi,

I have written a script to compress and uncompress binary files of a selected directory (and the sub-directories). I need to activate the script before I commit files to SVN.

  1. Is there a way to use the pre-commit hook to execute the script? and if so, how do I give to the he script the root directory (so it would scan the sub-folders and compress) ? and what should I write in the hook to execute the script?

  2. The same thing I need to do when I CHECK OUT files. I need to execute a script. Again I need the path of the local root, and also, there is no POST-CHECK-OUT hook, so how can I execute the script?

thanks,

Oded

+2  A: 

There's no way to accomplish this with normal subversion "hook script" as these are all server-side.

The subversion command line client does not support client-side hooks. You'll have to write your own scripts to wrap for example svn update and then use those scripts instead of the svn command they wrap.

TortoiseSVN does, as far as I know, support client side hooks. You may be in luck if you're using that.

Why, out of curiosity, do you need to do this in the first place?

bendin
I'm doing this because I have large binary files that I want to compress before I commit them and uncompress after I check out.Do you have another idea for me how to accomplish this?
Oded
Have you actually tried this without compression to see how it affects repository size? I ask because: (1) subversion already compresses content on the server, (2) compressing before commit will obscure similarities between versions making it impossible for subversion to save space on the server by storing only the difference between one version and the next.
bendin