Add file in prepare script in cornerstone, or say, start-commit hook of svn?

442 Views Asked by At

I'm trying to add a hook script in Cornerstone, to generate a meta file for each binary file to be committed, and of course, try to add those meta files to commit.

But here I have problem adding them, I mean, to the list to commit.

I saw this but it's about TortoiseSVN: Automatically add files to SVN inside a specific folder. And their doc says something like PATH but still I don't know how to use it. http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks

The Cornerstone doc says

Archiving documents as .zip files ready for commit in order to workaround issues with package-format documents placed under version control.

But it's not very clear whether "ready for commit" means adding the .zip file to commit.

Basically I wonder, is that possible? even with command line svn? I haven't found this kind of ready made script, adding files to the list to commit in start-commit hook. Really wish someone could give a hand here.

Thanks in advance!

Pine

1

There are 1 best solutions below

0
On

There is no standard for client-side hooks/scripts with Subversion, so anything that you write will be client-specific. TortoiseSVN has a hooks implementation, Cornerstone apparently calls them Commit Actions.

On the command line, keeping with UNIX tradition, the solution is to write a wrapper around the existing client/client libraries.

Unless Cornerstone (or your network management tools) has some way of distributing Commit Actions to all clients, you will need to distribute them to all clients, and add safeguards on the server via a pre-commit hook to validate that your meta files are coming along for the ride in the commit when appropriate. You should do this regardless, as you can't completely trust the client to do the right thing