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

svn:special property gets removed when replacing a symlink when no commit is made between svn remove and svn add

From: Dennis Brakhane <brakhane_at_googlemail.com>
Date: 2007-10-29 14:39:09 CET

(I wrote the following emails a few days ago, but it apparently didn't
get through - maybe because I wasn't subscribed. I've subscribed now
and now I try to mail it again)

Hi.

Today I stumbled upon a nasty behaviour of SVN, and I'm pretty sure
it's a bug. So I post it here hoping that I'll get a green light for
adding it to the issue tracker.

The problem: The svn:special property gets lost if you replace a
symlink with a different one without commiting inbetween.

I think I just demonstrate it via my trusty bash:

$ svn --version
svn, Version 1.4.4 (r25188)

(Since 1.4.5 only has a security fix, I didn't bother to compile 1.4.5)

First, let's create a repository:

$ svnadmin create /tmp/dummyrepo
$ mkdir /tmp/foo
$ touch /tmp/foo/foo
$ svn import /tmp/foo file:///tmp/dummyrepo -m ""

Now check out the repo twice:

/tmp$ svn co file:///tmp/dummyrepo 1
A 1/foo
Checked out revision 1.
/tmp$ svn co file:///tmp/dummyrepo 2
A 2/foo
Checked out revision 1.

Create a symlink in 1, check it in and update 2

/tmp$ cd 1
/tmp/1$ ln -s foo bar
/tmp/1$ svn add bar
A bar
/tmp/1$ svn commit -m ""
Adding bar
Transmitting file data .
Committed revision 2.
/tmp/1$ cd ../2
/tmp/2$ svn up
A bar
Updated to revision 2.
/tmp/2$ ls -l
total 0
lrwxrwxrwx 1 dennis dennis 3 Oct 27 00:09 bar -> foo
-rw-r--r-- 1 dennis dennis 0 Oct 27 00:07 foo

So far so good. Now replace the symlink (it doesn't matter whether the new one
 points to the same file or not), *without* committing inbetween:

/tmp/1$ svn rm bar
D bar
/tmp/1$ ln -s foo bar
/tmp/1$ svn add bar ; svn commit -m ""
A bar
Replacing bar
Transmitting file data .
Committed revision 3.
/tmp/1$ svn proplist bar # <-- the property svn:special is gone
/tmp/1$ cd ../2
/tmp/2$ svn up
D bar
A bar
Updated to revision 3.
/tmp/2$ ls -l
total 4
-rw-r--r-- 1 dennis dennis 8 Oct 27 00:11 bar
-rw-r--r-- 1 dennis dennis 0 Oct 27 00:07 foo
/tmp/2$ svn proplist bar
/tmp/2$ cat bar; echo
link foo

bar has lost the svn:special property.

Now, do the same again, and bar will regain the special property

/tmp/2$ cd ../1
/tmp/1$ svn rm bar; ln -s foo bar; svn add bar; svn commit -m ""
D bar
A bar
Replacing bar
Transmitting file data .
Committed revision 4.
/tmp/1$ svn proplist bar
Properties on 'bar':
  svn:special
/tmp/1$ cd ../2
/tmp/2$ svn up
D bar
A bar
Updated to revision 4.
/tmp/2$ ls -l
total 0
lrwxrwxrwx 1 dennis dennis 3 Oct 27 00:13 bar -> foo
-rw-r--r-- 1 dennis dennis 0 Oct 27 00:07 foo
/tmp/2$ svn propget bar
/tmp/2$ svn proplist bar
Properties on 'bar':
  svn:special

However, if a commit it made between the svn rm and svn add, the bug
does not occur (you can ignore the missing revisions, I did some
additional tests inbetween):

/tmp/1$ svn proplist bar
/tmp/1$ svn rm bar; svn commit -m "" ; ln -s foo bar; svn add bar; svn
commit -m ""
D bar
Deleting bar

Committed revision 8.
A bar
Adding bar
Transmitting file data .
Committed revision 9.
/tmp/1$ svn proplist bar
Properties on 'bar':
  svn:special

And once more, just to show that svn:special stays...

/tmp/1$ svn rm bar; svn commit -m "" ; ln -s foo bar; svn add bar; svn
commit -m ""
D bar
Deleting bar

Committed revision 10.
A bar
Adding bar
Transmitting file data .
Committed revision 11.
/tmp/1$ svn proplist bar
Properties on 'bar':
  svn:special

Greetings,
  Dennis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Oct 29 15:00:25 2007

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