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

Re: server hooks for post-commit metadata modifications?

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-12-07 01:58:32 CET

On Fri, 2003-12-05 at 09:24, Eric Jonas wrote:
> Hello! Is there any way to use the hooks mechanism to modify individual
> file/dir metadata without requiring another commit? Ideally, I'd like to
> have users of the repository commit a change, have the server update a
> certain property on all the files, and then have the commit proceed.

This is BAD. Do NOT do this. Read the warning in the pre-commit hook
template:

# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN. ***
# This is why we recommend using the read-only 'svnlook' utility.
# In the future, Subversion may enforce the rule that pre-commit
# hooks should not modify txns, or else come up with a mechanism
# to make it safe to do so (by informing the committing client of
# the changes). However, right now neither mechanism is
# implemented, so hook writers just have to be careful.

If the pre-commit hook modifies the commit transaction, the client will
be forever in the dark. It will think that the new revision looks one
way, but in reality, it will be something completely different in the
repository. There's currently no way for a pre-commit hook to "inform
the client" that something different was committed than what the client
sent.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Dec 7 01:59:16 2003

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.