[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: <kmradke_at_rockwellcollins.com>
Date: Wed, 9 Jan 2008 10:38:44 -0600

Greg Thomas <thomasgd_at_omc.bt.co.uk> wrote on 01/08/2008 10:50:00 AM:
> 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.

The pre-commit.tmpl file appears to suggest changing revision properties
is ok:

# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***

I haven't tested to see what happens, but if this is true, it would
mean the extra commit step should not be required if you enable
revision propchanges on your repo and you use --revprop instead.

Anyone see any big problems with this?

Kevin R.

---------------------------------------------------------------------
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-09 17:41:21 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.