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

Re: Which hook to check-in an automatically built ChangeLog?

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2004-12-20 21:50:34 CET

Patrick Ben Koetter wrote:
> I want to automatically create a ChangeLog from Subversions log using
> svn2cl <http://tiefighter.et.tudelft.nl/~arthur/svn2cl/>.
>
> Doing this manually works as expected.
>
> Now I want subversion to do this for me, but I am not clear about which
> hook I should use.
>
> Here's what I want to have:
> + The ChangeLog should include my current commit.
> + The ChangeLog should be committed together with my current commit.
>
> To me it looks as if "start-commit" is the right hook, because it "is
> run before the commit transaction is even created".
>
> Or is it "pre-commit", because it "is run when the transaction is
> complete, but before it is committed"?

You can't do that. Neither start-commit or pre-commit can modify the
contents of the transaction, because the change has no way to be
communicated back to the client, so you would end up with a working copy
that thought it was up to date with the new revision you're committing
to the repository, but in actuality is not. There are warnings in the
hook script templates about this problem.

The best you can do is have a post-commit hook script modify and commit
the ChangeLog, but you need to be sure that it doesn't fire on the
commits it is performing, to avoid infinite loops.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 20 21:53:26 2004

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.