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

Re: Incorrect lock becuase post-lock fails

From: Clint Lawrence <clint.lawrence_at_gmail.com>
Date: Mon, 30 Jun 2008 12:11:34 +0100

2008/6/23 Giulio Troccoli <Giulio.Troccoli_at_uk.linedata.com>:
> I have found something that, in my view, is a bug. It's easily
> reproducible with the script attached (it's a Korn Shell script but it'd
> be easy to change it for Windows).
>
> If the post-lock hooks fails, the user get the message "Lock succeeded,
> but post-lock hook failed". It seems correct, especially because, AFAIK,
> the exit code of the post- hook doesn't matter.

Yes I can reproduce this bug. It exists in the current trunk also.

> The file is indeed locked, but with a status of O instead of K. From the
> Subversion book, O means that the files is locked by someone else
> (wrong) or somewhere else (wrong). Although the file seems to be locked,
> if it has the svn:needs-lock property set it's still read-only (but
> maybe this is related to the fact that Subversion thinks that the file
> is not locked in that WC).

This happens regardless of having the svn:needs-lock property set. As far
as I can tell it is related only to the fact that the post-lock script
returns a
failure. i.e. you don't need to have svn:needs-lock set on the file,
or a pre-lock
script to see this behaviour.

> I discovered the problem because my post-lock script did not have an
> "exit 0" at the end and the return code was not zero (there was an error
> with the set command). As you can see, my script simply creates a
> post-hook with "exit 1" to make it failing.
>
> Anyhow, I believe this is not the correct behaviour. As clearly state in
> the message that Subversion returns, the lock has succeeded (as it
> should since the post-lock return code shouldn't matter) but not in the
> right way: you cannot commit, nor you can unlock the file. The only way
> to remove the lock is to use svnadmin rmlocks.

You should also be able to remove the lock from the client by using:
svn unlock --force foo

> I'm using Subversion 1.4.4
>
> Am I missing something or is it really a bug?

Yes I think this is a bug also. Perhaps you should file an issue?

Cheers,
Clint

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-30 13:11:55 CEST

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.