Thank you very much,
This should do what I want, I will try it soon.
Might it be a good idea to setup a repository of useful scripts like
this? Perhaps in some sort of wiki so that it would be easy for people
to fix any typos and also keep a full history of any changes?
> -----Original Message-----
> From: Lieven Govaerts [mailto:email@example.com]
> Sent: 12 December 2005 18:42
> To: Thompson, Graeme (AELE)
> Cc: firstname.lastname@example.org; 'Subversion'
> Subject: RE: Re: Need checkout commits...
> > Quoting "Thompson, Graeme (AELE)"
> > <Graeme.Thompson@smiths-aerospace.com>:
> > >
> > > I have just tried this with a subversion 1.2.3 server on
> > SUSE 10 and a
> > > TortoiseSVN 1.2.6 client.
> > >
> > > It does not *Require* you to have a lock in order to
> commit a file
> > > with the svn:needs-lock property. You can simply make the file
> > > writable and then do a commit and it will happily go ahead
> > and update the repository.
> > >
> > > Is there any way to get this to be a requirement, e.g. through a
> > > pre-commit hook similar to the suggested one to ensure that
> > all files
> > > have the svn:needs-lock property set?
> > >
> > > If so then has anyone got any examples of how to do this?
> > This would be easy to build using "svnlook propget".
> > If no one has an example file available I'll create one
> this evening.
> this simple pre-commit script checks if all files in a
> transaction were
> in the repository. It doesn't check if that was your lock (
> commit will fail
> anyway ), nor does it filter on extensions ( not that
> difficult to add ).
> You might clean it up a bit.
> COMMITFILES=`svnlook changed -t $TXN $REPOS`
> #save the current IFS
> # iterate over all files in the transaction
> for line in $COMMITFILES; do
> line=`echo $line | cut -c 5-`
> LOCKSET=`svnlook lock $REPOS "/$line" | grep "UUID
> Token" | wc
> if [ $LOCKSET = 0 ]; then
> #reset the old IFS
> return 1
> #return the old IFS
> return 0
> if [ $? = 1 ]; then
> echo "Failed commit because file '$REPLY' wasn't locked before
> commit!" >&2
> exit 1
> # All checks passed, so allow the commit.
> exit 0
> Hope this helps.
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.13.13/197 - Release
> Date: 9/12/2005
The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue Dec 13 10:58:17 2005