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

Re: Setting up the Configuration File

From: Robert Mohr <mohr.42_at_gmail.com>
Date: 2005-03-31 19:47:27 CEST

On Thu, 31 Mar 2005 12:03:24 -0500, Weintraub, David
<David.Weintraub@ilex.com> wrote:
> Okay, I now know that I can't setup a config file for a server in order to
> make sure that the svn:keywords property is set.
> However, I've been playing around with the pre-commit hook, and have come up
> with the following little tidbit of Kornshell code which looks at all the
> files that are being changed, and checks the svn:keywords property to see if
> it is set:
> svnlook changed -t $TXN $REPOS | while read type path
> do
> prop=$(svnlook propget -t $TXN $REPOS svn:keywords $path 2> /dev/null)
> if [ ! $prop ]
> then
> print -u2 "No property svn:keywords is set for $path!\n"
> else
> print -u2 "Keywords property is $prop"
> fi
> done
> This means I can prevent someone from committing their changes if the
> svn:keywords property isn't set for a file. I could even give the command
> they need to run.
> However, what I'd really like to do is set the svn:keywords property for the
> user, but I can't figure out how to do that. The commit script is running on
> the server and not on the client who has the working directory checkedout,
> so I can't do an "svn propset". But, neither svnadmin nor svnlook allow me
> to set a property.
> I'm pretty new to Subversion and might be missing something fairly obvious.
> Is there a way for the server to "fix" this transaction and set the
> svn:keywords property for the user?

Use the post-commit hook in roughly the same capacity as your current
pre-commit, and call 'svn propset svn:keywords Id
file://localhost$path' when keywords are not set. Then call 'svn
commit -m "Automatically setting svn:keywords to 'Id'."'

This results in an extra revision whenever a file without svn:keywords
set is committed, but I don't see how else to do this.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 31 19:59:59 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.