[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: Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com>
Date: Fri, 28 Nov 2008 09:53:20 +0000

>
> > 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 am in the process of upgrading our test server to 1.5.1 to see whether I can replicate the problem there (as I said I'm using 1.4.4 at the moment). I hope that maybe it as already been fixed, but I would be grateful to everybody who would like to run my script and tell me what was the result.

Thanks
Giulio

Linedata Services (UK) Ltd
Registered Office: Bishopsgate Court, 4-12 Norton Folgate, London, E1 6DB
Registered in England and Wales No 3027851 VAT Reg No 778499447

---------------------------------------------------------------------
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 10:53:51 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.