views:

1176

answers:

3

Hi all,

I'm trying to setup Xcode SCM using Subversion (SVN) on a network disk (mounted). I was able to setup SVN repository on my machine locally, and everything worked smoothly without any hassle. Reference Article: Version Control is Your Friend by Jeff LaMarche

My problem is that I'm unable to set-up SVN on a network drive (mounted).

cd [mounted_drive]/Users/Shared 
mkdir subversion 
cd subversion 
mkdir HelloWorld 
svnadmin create HelloWorld
chmod -R 777 HelloWorld

The above commands work fine and main subversion repository is successfully created. The problem is that it doesn't allow me to create sub-folders (trunk, branch, and tag) in the main SVN repository.

svn mkdir
file:///[mounted_drive]/Users/Shared/Subversion/HelloWorld/trunk
file:///[mounted_drive]/Users/Shared/Subversion/HelloWorld/branch
file:///[mounted_drive]/Users/Shared/Subversion/HelloWorld/tag

When i try to run the svn mkdir command above, I get the following svn error:

"svn: Can't get exclusive lock on file '[mounted_drive]/[subversion_repository_directory]/db/write-lock': Operation not supported"

If i control the remote machine, and run the above command natively, it works and trunk, branch and tag directories are created.

After setting the Xcode's SCM to the remote repository, if i try to "Import" code into this repository (remotely), Xcode returns the following error:

"svn: Can't get exclusive lock on file '[mounted_drive]/[subversion_repository_directory]/db/transactions/3-1.txvn/rev-lock': Operation not supported"

Crux of this whole story: I'm facing a lot of issues while setting-up SVN on a network drive. Any help will be greatly appreciated.

+1  A: 

Networked file systems, depending upon protocol used and configuration, may not support all the functions of your local file system. Subversion is trying to get an exclusive lock on the network file system, but can't. You could change the configuration of your server, maybe by adjusting permissions on your Subversion directories, or using a different protocol. But, using a network volume is the wrong approach in the first place.

What you really want to do is set up a Subversion server on the networked server, and check out a local copy of the repository while working on a project.

Mr. Berna
+2  A: 

Go read the book. I'll wait. Seriously.

Do not set up a shared repository by tossing it on a network drive and then talking to it via file:///. file:/// access to repositories is only meant for local disk because of (among other things) the locking semantics of network file systems.

Instead, choose a computer on which you'll keep your repositories. Let's call it Hezikiah Run svnserve on that system to make the repositories available on the network. Access your repository as svn://hezikia/REPO_NAME.

The book is a great help there.

bendin
Thanks for the response. I actually got it working with Mac OSX 10.5.x, but I'm stuck with setting it up on Mac OS 10.4.x :) I figured that the best way to access a remote repository is using svn+ssh:// rather than file:///. But now I'm stuck at actually setting-up svn on Mac OSX 10.4 so that i can access it using svn+ssh://. I've posted a new question here: http://stackoverflow.com/questions/2077567/installing-svn-on-mac-os-x-10-4-and-accessing-it-using-svnssh-url
Mustafa
Mac OS X 10.5 has made all this stuff so easy. How do you run svnserve on Mac OS 10.4? And, will that be enough to access the repository via svn+ssh:// URL?
Mustafa
A: 

It is possible to build a version of subversion that doesn't have this problem. It seems that the problem is the apr and apr-util libraries (see Subversion, Mac OS X, and SMB).

The work around I used is to compile subversion using OS X's versions apr, apr-util & apxs libraries.

Here is how to do it:

  1. Get the a svn tarball, and un-tar it somewhere suitable
  2. ./configure --prefix=/opt/subversion/ --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --without-berkeley-db --with-apxs=/usr/sbin/apxs

    • --prefix=/opt/subversion/: put subversion in /opt/subversion, which is handy if you use svnX.
    • --with-apr=/usr/local/apr: use OS X's apr library.
    • --with-apr-util=/usr/local/apr: use OS X's apr-util library.
    • --with-apxs=/usr/sbin/apxs: use OS X's apxs library.
    • --without-berkeley-db: This isn't strictly part of the fix, but I've never used anything other than subversion FSFS, so I don't build with berkeley-db.
  3. sudo make install

I have successfully done this on OS X 10.5, with subversion 1.6.13.

svnX is happy with this too.

Yafiyogi