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

Re: Pre-commit hooks and access to files

From: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Tue, 18 Aug 2009 09:17:55 +1000

On Tue, Aug 18, 2009 at 9:05 AM, Douglas Bullard<dbullard_at_nurflugel.com>
wrote:
> I'm investigating whether it's possible to modify the contents of
> files in pre-commit hooks (such as inserting author's names and
> revision numbers in class comments, etc).
>
> The docs for pre-commit hooks say that modification of the
> contents of a transaction are prohibited. Would this preclude me
> from doing this?
>
> If not, how would I get a handle of the file contents to modify -
> svnlook doesn't seem to do this.
>
> I understand that people have strong opinions on this, but I'm
> investigating whether it's possible, the advisabitlity of doing so
> is another conversation.

You can examine the file contents in the pre-commit hook using:

svnlook cat
>

However, as to modification of the file, I do not believe that is possible
(and is certainly not advisable).

If it is author/revision information you are after, have you considered
using SVN's keyword substitution?

http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html

Cheers,
Daniel B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2384566

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-18 01:18:53 CEST

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.