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

Re: Bug: "svn diff symlink" gives error "Unable to lock '.'"

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2007-02-14 14:34:10 CET

On Mon, Feb 12, 2007 at 10:49:19AM +0100, Vincent Lefevre wrote:
> This can be reproduced (on both Mac OS X and Linux) with:
>
> $ svnadmin create svn
> $ svn co file://`pwd`/svn wc
> Checked out revision 0.
> $ cd wc
> $ ln -s . foo
> $ svn add foo
> A foo
> $ svn diff
> [works]
>
> $ svn diff foo
> svn: Unable to lock '.'
> zsh: exit 1 svn diff foo
>

This problem isn't unique to links-to-cwd. It also occurs with links to
directories below cwd. The problem seems to be caused by the fact that we
originally get an adm_access baton just for the entry that represents the
link (the anchor), and then call svn_wc_probe_retrieve() to get an access
baton for the target of the operation (in this case, the link again).

The problem occurs because libsvn_wc/lock.c:probe() correctly decides
that the link isn't a directory, and so tries to lock the directory
containing that link. Since the original access baton doesn't include
the directory, this fails.

[Can anyone explain why this problem doesn't occur if the link is to a
directory that's not within the wc in question?]

I'm not sure what the correct fix is here - should probe() test for
symlinks-to-directories? That seems like it might open a whole other
can of worms, though I can't see any other obvious place to fix it.

I've filed issue #2716 to cover this.

Regards,
Malcolm

  • application/pgp-signature attachment: stored
Received on Wed Feb 14 14:34:28 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.