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

Re: Possible to perform substitution in text-files with property values

From: Lakshman Srilakshmanan <lakshman.srilakshmanan_at_tradingpost.com.au>
Date: 2006-10-03 03:27:27 CEST

Hi Ken,

You could implement a pre-commit hook to reject any files that don't have the copyright and license.

This would not only make your life easier but it will put the onus back on the developer.

Thanks
Lakshman

> -----Original Message-----
> From: Ryan Schmidt [mailto:subversion-2006d@ryandesign.com]
> Sent: Tuesday, 3 October 2006 1:22 AM
> To: Ken A. Redergård
> Cc: users@subversion.tigris.org
> Subject: Re: Possible to perform substitution in text-files with property values
>
> On Oct 2, 2006, at 05:28, Ken A. Redergård wrote:
>
> > Is it possible to perform substitution in text-files with property
> > values ?
> >
> > For example I would like to have a copyright and license text at
> > the top in the file.
> >
> > $copyright$
> > $license$
> >
> > Now I set the properties copyright and license at some directory
> > higher in the directory structure.
> >
> > When I have set the properties I would like to have the $copyright$
> > and $license$ replaced with the text in the properties.
>
> No, there is no such feature in Subversion.
>
> A workaround could be to write a wrapper script around the "svn
> commit" command which substitutes these variables before performing
> the commit. This would only work if everybody uses the command-line
> client, and you would need to write different versions if you use
> multiple operating systems on the client (for example Windows and
> Linux).
>
> Another option could be to write a post-commit hook which examines
> the commit which just occurred, and if these placeholders are still
> present in the file, to immediately perform another commit in which
> these placeholders are replaced with the content you want. This would
> work regardless of the client settings and there would be nothing to
> set up on the client, which could be an advantage, but such a hook
> script can be complicated to write because the it must maintain its
> own working copy in which to perform these modifications.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 3 04:13:47 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.