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

RE: Altering source file contents with hooks

From: HAND,Nathan <Nathan.HAND_at_dewr.gov.au>
Date: 2005-03-08 00:57:01 CET

-----Original Message-----
From: Eric Thomas [mailto:eric@psteering.com]
> I'm curious - is there a way, using any of the Subversion
pre-/post-/start-commit hooks,
> to alter the actual contents of a source file before it's committed?
For example, we might
> want to add a commented copyright notice to every source file, or run
every file through a
> "pretty-printer" program to standardize formatting.

The subversion server doesn't have access to the source file. It only
receives deltas. So it's simply not possible. Consider the common case
where the subversion server is across a network.

The solution in this case it to create a wrapper script for svn. Call it
"svn-that-modifies-files". Make changes to your source files in that
script and then call the real svn.

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege. If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Mar 8 00:59:32 2005

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.