[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: testing hooks locally

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-01-24 13:55:55 CET

On Jan 23, 2006, at 23:37, Hill, Don [WHQKH] wrote:
> I have a large number of files and what I want to know is there any
> way to process the hooks without doing a commit, if I have a hook
> that requires some copyright and files don’t have them will fail,
> what I want is a way to run the hooks before I attempt to commit
> the files.

I think the other two responses that have come in are somewhat
missing your point...

As I understand it, you want to be able to run a script on your
client machine which verifies that your changed files will pass a pre-
commit hook's checks. Presumably you want to do this because you have
a slow network and many changes and transmitting them will take a
long time and you want to avoid this if the hook will deny your
commit anyway. The answer is that there are no client-side hooks in
Subversion, so there is no built-in solution to this problem. You may
wish to split your pre-commit hook into two parts: the part that gets
the data to be checked out of the transaction, and the part that
actually checks it. Then, you can copy the part that actually checks
the data to your client machine and write a different script which
first finds the changed files in your working copy (for example by
parsing the output of "svn st") and send these to the checking
script. You could either make this a script that merely checks your
working copy for correctness, or you could go so far as to call it
something like "svncommit.sh" such that it would even commit the
files if they pass validation, and print an error message if they
don't. Of course that's up to you. Either way, you'll have to
manually keep the client version in sync with the server version,
should changes be made to the server version.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jan 24 14:02:24 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.