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

Re: Problem with deleting locked file using http: scheme

From: Andy Levy <andy.levy_at_gmail.com>
Date: Fri, 28 Nov 2008 07:54:37 -0500

On Fri, Nov 28, 2008 at 04:53, Giulio Troccoli
<Giulio.Troccoli_at_uk.linedata.com> wrote:
>>
>> > From: Giulio Troccoli [mailto:Giulio.Troccoli_at_uk.linedata.com]
>> > Sent: 24 November 2008 15:44
>> > To: users_at_subversion.tigris.org
>> > Subject: Problem with deleting locked file using http: scheme
>> >
>> > Hi everybody.
>> >
>> > We have a repository that contains a lot of Word and Excel documents. I
>> > have therefore implemented a locking process and instructed my user to
>> > lock, modify and then commit.
>> >
>> > As recommended I have also written a pre-commit hook that checks whether
>> > the files being committed are Word or Excel document and in that case
>> > whether they are locked (by the same user) or not.
>> >
>> > One of my users came back to me the other day saying she was trying to
>> > delete a Word document but the pre-commit hook rejected the commit
>> because
>> > the file was not locked. The file had been locked however.
>> >
>> > After some research I found out before the pre-commit hook was executed
>> > the lock has disappeared. I was trying to replicate the error but
>> behold,
>> > it worked!! Finally, today I find out that it worked because I was using
>> > the file: protocol. So, I modified the script I used to use the http:
>> > protocol (and I have modified the Apache configuration too) and I have
>> > successfully reproduced the error.
>> >
>> > I know this is not strictly a Subversion issue, but could anybody help
>> me.
>> > I'm not an expert in Apache and I don't really now how to read the log
>> > file.
>> >
>> > I am using Subversion 1.4.4 and Apache 2.0 on a RHEL4 server.
>> >
>> > I have attached the script I used (svn-lock-test.lsk) and the pre-commit
>> > hook (lock-test-pre-commit). You will need to comment/uncomment the
>> > checkout line to use either the file: or http: protocol. The pre-commit
>> > hook is actually an extract of the real pre-commit hook, but I have
>> > deleted all the bits related to other projects we have in the same
>> > repository
>>
>> Sorry, for some reason the script wasn't attached, so here it is
>>
>> #!/bin/ksh
>>
>> set -x
>>
>> SVNADMIN=/usr/bin/svnadmin
>> SVNLOOK=/usr/bin/svnlook
>> SVN=/usr/bin/svn
>> CP=/bin/cp
>> RM=/bin/rm
>> CHMOD=/bin/chmod
>>
>> HOME=/home/svn
>> REPO_PATH=$HOME/lock-test-repo
>> REPO_URL=localhost/lock-test-repo
>> WC=$HOME/lock-test-wc
>>
>> $RM -rf $REPO_PATH $WC
>>
>> $SVNADMIN create $REPO_PATH
>>
>> #$SVN co file:///$REPO_PATH $WC
>> $SVN co http://$REPO_URL $WC
>>
>> $SVN info $WC > $WC/test.txt
>> $SVN add $WC/test.txt
>> $SVN ci $WC -m"add"
>>
>> $SVN up $WC
>>
>> $SVN lock $WC/test.txt
>> $SVN rm $WC/test.txt
>>
>> $CP $HOME/lock-test-pre-commit $REPO_PATH/hooks/pre-commit
>> $CHMOD u+x $REPO_PATH/hooks/pre-commit
>>
>> $SVN st $WC
>> $SVNLOOK lock $REPO_PATH test.txt
>>
>> $SVN ci $WC -m"delete"
>> $SVN st $WC
>> $SVNADMIN lslocks $REPO_PATH
>
> I don't usual do this, but it's been few days now and I'm surprise that nobody has even tried to replicate my problem (given I posted a nice script to do so). So maybe my email has just gone unnoticed.

I've seen your post twice before, but please bear in mind that it is a
holiday week, at least in the US.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-28 13:55:00 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.