简体   繁体   中英

Settingup SCM using Xcode and SVN (Subversion)

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.

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.

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.

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.

Great, I compiled my own subversion using Yafiyogi's hint - great man it works, no lock file troubles anymore! I'm able to access a subversion repository on a timecapsule disk via AFP resp. WLAN remotely using the versions svn client. My confiuration:

  • Mac OS X 10.6.6 (10J567) (Darwin 10.6.0)
  • apr-1.4.2 (using plain configure/make/make install)
  • apr-util-1.3.10 (using ./configure --with-apr=/usr/local/apr/make/make install )
  • subversion-1.6.16 (using Yafiyogi's hint above)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM