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

Re: Automatically change property

From: Greg Thomas <thomasgd_at_omc.bt.co.uk>
Date: Tue, 08 Jan 2008 16:50:00 +0000

On Tue, 8 Jan 2008 15:54:37 +0100 , "Ehler, Benedikt"
<B.Ehler_at_kostal.com> wrote:

>Is it possible to change a property via a hook script? We want to emulate a
>CVS-like revision number by properties. So every file should get a property
>called "Revision_Number" or something like that. The value of this prop
>should be counted up every time a new version of this file is checked in
>(like CVS/PVCS).

Yes, although you'll double the number of commits in your repository.
You would need to write a post-commit script to

(a) check out a local copy
(b) update the property using "svn propset"
(c) commit the change back
(d) tidy up the local working copy

Note that the committers working copy will immediately be out of date,
but assuming they don't edit the property manually I don't see any
merge conflicts occurring.

Note that there is a long standing issue -
http://subversion.tigris.org/issues/show_bug.cgi?id=2238 - which would
allow you to perform a "svn propset" on the repository URL directly,
which would make the post-commit script somewhat easier to write -
there would be no need to checkout a local working copy.

Whatever you do, don't change the file in the pre-commit hook.


This post represents the views of the author and does
not necessarily accurately represent the views of BT.
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-01-08 17:50:47 CET

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.