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

Re: [BUG] Directory obstructing deletion of symlink

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2006-03-08 23:14:01 CET

Felix Wiemann <Felix.Wiemann@gmx.net> writes:

> I think that there is a bug in Subversion which is triggered when a
> directory obstructs the deletion of a symlink.
>
> I'm using Subversion 1.2.3 (I'm sorry I can't update at the moment) and
> APR 0.9.6 on Linux 2.6 (Gentoo).
>
> ~/tmp $ svnadmin create testrepos
>
> ~/tmp $ svn co file:///home/felix/tmp/testrepos co1
> Checked out revision 0.
>
> ~/tmp $ svn co file:///home/felix/tmp/testrepos co2
> Checked out revision 0.
>
> ~/tmp $ cd co1
>
> ~/tmp/co1 $ ln -s something mylink
>
> ~/tmp/co1 $ svn add mylink
> A mylink
>
> ~/tmp/co1 $ svn ci -m ''
> Adding mylink
> Transmitting file data .
> Committed revision 1.
>
> ~/tmp/co1 $ cd ../co2
>
> ~/tmp/co2 $ svn up
> A mylink
> Updated to revision 1.
>
> ~/tmp/co2 $ rm mylink
>
> ~/tmp/co2 $ mkdir mylink
>
> # This is OK:
> ~/tmp/co2 $ svn st
> ~ mylink
>
> ~/tmp/co2 $ cd ../co1
>
> ~/tmp/co1 $ svn del mylink
> D mylink
>
> ~/tmp/co1 $ svn ci -m ''
> Deleting mylink
>
> Committed revision 2.
>
> ~/tmp/co1 $ cd ../co2
>
> # The "mylink" directory obstructs the deletion of the symlink, but
> # Subversion doesn't complain:
> ~/tmp/co2 $ svn up
> At revision 2.

Using trunk:

$ svn st -v
                1 1 pm .
~ 1 1 pm mylink
$ svn up
svn: In directory '.'
svn: Error processing command 'delete-entry' in '.'
svn: Can't remove file 'mylink': Is a directory
$ svn st -v
? mylink
! L 2 1 pm .
$ rmdir mylink
$ svn cleanup
$ svn up
At revision 2.
$ svn st -v
                2 2 pm .

> ~/tmp/co2 $ svn st
> ~ mylink
>
> ~/tmp/co2 $ rmdir mylink
>
> # This is the bug: Subversion restores the symlink even though it does
> # not exist in revision 2.
> ~/tmp/co2 $ svn up
> Restored 'mylink'
> At revision 2.
>
> ~/tmp/co2 $ ls -l mylink
> lrwxr-xr-x 1 felix users 9 Mar 6 19:31 mylink -> something
>
> # This is the bug: Subversion thinks that the symlink still exists in
> # revision 2.
> ~/tmp/co2 $ svn st -v
> 2 2 felix .
> 2 1 felix mylink
>
> ~/tmp/co2 $ svn del mylink
> D mylink
>
> ~/tmp/co2 $ svn ci -m ''
> Deleting mylink
>
> Committed revision 3.
>
> # Subversion committed an empty revision:
> ~/tmp/co2 $ svn di -r2:3

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 8 23:14:33 2006

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.