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

Re: How to Modify the transaction file

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-07-12 21:44:08 CEST

On Jul 12, 2007, at 04:32, Dong Jiwei wrote:

> I want to write a hook that can modify the file to be committed, for
> example, it the file is a shell script, then I want to add one line
> "echo
> $END_DATE" at the file end.
> How can I got the file and modify it in hooks?

Don't do that. Instead, you can write a pre-commit hook which rejects
the commit of any file that doesn't end with that line. Then instruct
your developers to add that line themselves before committing.

> And one more question is will this operation cause the inconsistence
> between the WC and REOPS?

That's exactly why you mustn't modify a transaction: the working copy
will think it has a file at, say, revision 42, but the repository
will think revision 42 looks different. When you later try to update,
things will blow up.

> I think the Subversion svn:keywords auto substitution may work of
> the same mechanism? Any one tell me how to do this?

Keyword substitution works differently. It works on the client side
only. The keywords are only expanded to their actual values upon
checkout or export; they're not stored that way in the repository.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jul 12 21:44:14 2007

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.