You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Felix Wiemann <Fe...@gmx.net> on 2006/03/06 20:11:41 UTC

[BUG] Directory obstructing deletion of symlink

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.

~/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

-- 
For private mail please ensure that the header contains 'Felix Wiemann'.

"the number of contributors [...] is strongly and inversely correlated with the
number of hoops each project makes a contributing user go through."      -- ESR


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [BUG] Directory obstructing deletion of symlink

Posted by Philip Martin <ph...@codematters.co.uk>.
Felix Wiemann <Fe...@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