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

Re: Modifying a file in pre-commit

From: Ryan Schmidt <subversion-2006c_at_ryandesign.com>
Date: 2006-08-21 16:10:33 CEST

On Aug 20, 2006, at 13:24, Adiseshan, Muthugopalakrishnan wrote:

> I would like to change the contents of a specific
> file (in the modified part of the file), as part of pre-commit
> hook.
> Is there any way to do it

Yes, you can do it, but no, you absolutely should not do it, because
it will break everything. See the big red warning box at the bottom
of this section:


> Warning
> Do not attempt to modify the transaction using hook scripts. A
> common example of this would be to automatically set properties
> such as svn:eol-style or svn:mime-type during the commit. While
> this might seem like a good idea, it causes problems. The main
> problem is that the client does not know about the change made by
> the hook script, and there is no way to inform the client that it
> is out-of-date. This inconsistency can lead to surprising and
> unexpected behavior.
> Instead of attempting to modify the transaction, it is much better
> to check the transaction in the pre-commit hook and reject the
> commit if it does not meet the desired requirements.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 21 16:13:15 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.