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

Re: automatic server-side setting of svn:keywords using hooks

From: <kmradke_at_rockwellcollins.com>
Date: Thu, 31 Jan 2008 13:50:20 -0600

Ryan Schmidt <subversion-2007b_at_ryandesign.com> wrote on 01/31/2008
01:19:02 PM:
> On Jan 31, 2008, at 12:50, Johannes Egger wrote:
> >>> I saw a big warning at http://svnbook.red-bean.com/en/1.1/
> >>> ch05s02.html (subversion 1.1) about
> >>> modifying a transaction using hook scripts. The 1.1 version of
> >>> the book specifically mentions
> >>> svn:eol-style and svn:mime-type. This is understandable.
> >>>
> >>> Version 1.4 is more explicit and talks about the client-side
> >>> cache which might become stale. Is
> >>> this a problem for *all* transaction modifications? Does it apply
> >>> to svn-keywords?
> >>
> >> Yes, it's a problem for all transaction modifications: all file and
> >> directory properties are cached on the client. The only server side
> >> commit-time modification which is relatively safe (for now) is to
> >> change revision properties. (But those don't have any relation with
> >> keywords.)
> >>
> >>> Is there any other way to automatically set properties on the
> >>> server-side that I'm not aware of?
> >>
> >> Yes, in a followup commit following the commit that didn't set the
> >> correct keywords.
> >
> > Thanks for your quick response. How would I go about doing that?
> > The commit hooks are only passed
> > the repo path and revision id as arguments. Would I have to check
> > which files have been added with
> > that revision id, then add svn:keywords properties and commit? E.g.
> > I'd parse the output of "svn
> > log" or some similar command etc?
>
> In the post-commit hook, you would check which files have been added/
> changed/deleted using
>
> svnlook changed $REPO -r $REV
>
> Your hook would need to maintain a working copy for itself somewhere
> on the server. It could update each directory that was changed, which
> you can find using
>
> svnlook dirs-changed $REPO -r $REV
>
> Then for each file changed, set the property. Then commit all changes.

I *thought* that the upcoming 1.5 was supposed to support
"svn propset PROPNAME PROPVAL URL" syntax.

If it does, it will make it a lot simpler to do these post-commit hook
property settings. (I.E. no server side working copy would be required)

For those working with large files this is a big win.

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-31 20:50:55 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.