After adding a symbolic link in a svn repository I keep receiving an error inside of that directory
Asked Answered
E

2

7

I created a symbolic link from /www/dir2/ to /home/dir2/ I then added it to the repository ( svn add /www/dir2/ ) Now if I go into that directory, and try to do anything with svn in there I receive a "svn: warning: '.' is not a working copy" error.
If I try to add a subdirectory (svn add /www/dir2/dir5 ) I receive the error:
svn: 'dir2' is not a working copy
svn: Can't open file 'dir2/.svn/entries': No such file or directory I tried committing the directory addition and that worked fine

From the log:
Changed paths:
A /www/dir2
svn pl dir2/
Properties on 'dir2':
svn:special

Any help would be appreciated. Thanks!

Expansive answered 29/1, 2009 at 3:18 Comment(0)
E
17

Subversion does not follow symbolic links. When a symlink is committed, it is stored in the database as a regular file with the svn:special property set. See the manual for more information.

If you want to add that directory to the repository, you will have to move (not symlink) it in to your working copy and then add it.

Empathize answered 29/1, 2009 at 6:57 Comment(0)
R
8

An alternative (usually only if you have a directory symlinked that you hoped svn would follow) would be to use something like:

mount --bind /real/path/to/dir /path/inside/working/dir

You could then add that path to the repo without problems.

In most cases, just moving the directory is a better idea (it won't clutter up fstabs, you won't have to remount it all the time, etc) -- but I figured I'd pass a tip along that can save you from doubling a directory just in the name of committing it.

Reaves answered 28/10, 2009 at 6:1 Comment(1)
+1 Yeah! Brilliant idea. This way you can circunvect directory hard-linking issuesPurchasable

© 2022 - 2024 — McMap. All rights reserved.