Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Subversion client (svn) derefence symbolic links as if they were files?

I have a directory on a Linux system that mostly contains symlinks to files on a different filesystem. I'd like to add the directory to a Subversion repository, dereferencing the symlinks in the process (treating them as the files they point to, rather than links). Generally, I'd like to be able to handle any working-copy operations with this behavior, but the 'svn add' command is where it starts, I think.

The SVN client utility doesn't appear to have any options related to symlink dereferencing in the working copy. I didn't find any references to this in the manual (http://svnbook.red-bean.com/en/1.5/index.html), either.

I found a poster on the SVN users mailing list who asked the same question but never received an answer, here:

  • http://markmail.org/message/ngchfnzlmm43yj7h

(That poster ended up using hard links instead of symlinks. That technique is not an option, in my case, because the real underlying files reside on a separate filesystem.)

I'm using Subversion v1.6.1 on Fedora 11.

For what it's worth, I know that there are alternative tools/techniques that could help approximate this behavior, but which I have to discard for various reasons. I've already considered [and dust-binned] these possibilities: - a "union" mount, merging all of the the directories containing the real files, with the SVN working-copy directory as the "top" layer in the union; - copying/moving the real files to the same filesystem as the SVN working-copy, and using hardlinks instead of symlinks; - non-SVN version control systems. These were all neat ideas, and I'm sure they are good solutions to other problems, but they won't work given the constraints of this environment and situation.

like image 748
Ryan B. Lynch Avatar asked Sep 04 '09 14:09

Ryan B. Lynch


People also ask

Where are symbolic links stored?

There is no way to find all the symbolic links pointing to a file. They could be anywhere, including on a filesystem that isn't mounted. With GNU or FreeBSD find, you can use find /some/dir -samefile /path/to/foo to find all the hard links to the file /path/to/foo that are under /some/dir .

How to create a symbolic link to a folder in Linux?

There is nothing hard in creating Symbolic links in Linux – you just need to follow one simple step. The ln command in Linux creates links between source files and directories. -s – the command for Symbolic Links. [Symbolic filename] – name of the symbolic link.


1 Answers

You have a lot of constraints but there is one thing that always works: hack the source.

You can easily build your own svn for linux, though making this mod may or may not be "easy". Anyway, if you don't have any managed symbolic links, you can make a crude hack and just have svn follow them always, as if they are hard links.

If your repository does contain versioned links, and you need to check out that part of it, then you will need a more sophisticated hack which, say, uses a property that controls the feature per file or per hierarchy or something.

There might be one other choice: versioned links appeared in 1.1.0, if the behavior prior to that was to follow symbolic links then perhaps you could just run an old client.

like image 134
DigitalRoss Avatar answered Nov 16 '22 00:11

DigitalRoss