问题
I updated the Subversion client on my system to 1.8.3. I did a checkout of my repository from Xcode 5's Source Control
menu. Then in terminal opened that directory and did an svn update
command just to check. I get this message -
The working copy at '/Path' is too old (format 29) to work with client version '1.8.3 (r1516576)' (expects format 31). You need to upgrade the working copy first.
If I upgrade my copy, I lose access to the Source Control menu options because the version is too high for XCode 5.
Later on I found this XCode 5 Features Link which says that SVN for Xcode is at version 1.7.9.
- I dont understand how there are 2 versions of SVN on my system ( one maintained by Xcode that is 1.7.9 and other at 1.8.3)
- How do I work with 1.8.3 and Xcode 5. I really want to use XCode's GUI.
回答1:
Writing to 'defaults' won't work for Xcode 5. Newer version of Xcode ship with it's own SVN binary located in:
/Applications/Xcode.app/Contents/Developer/usr/bin/
You need to replace this binary to upgrade Xcode's SVN client to 1.8. Assuming your new SVN client is located in /usr/local/bin/ (default brew install path) type the following in a terminal:
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo mv ./svn ./svn.org
sudo mv ./svnadmin ./svnadmin.org
sudo mv ./svndumpfilter ./svndumpfilter.org
sudo mv ./svnlook ./svnlook.org
sudo mv ./svnrdump ./svnrdump.org
sudo mv ./svnserve ./svnserve.org
sudo mv ./svnsync ./svnsync.org
sudo mv ./svnversion ./svnversion.org
sudo ln -Ff /usr/local/bin/svn svn
sudo ln -Ff /usr/local/bin/svnadmin svnadmin
sudo ln -Ff /usr/local/bin/svndumpfilter svndumpfilter
sudo ln -Ff /usr/local/bin/svnlook svnlook
sudo ln -Ff /usr/local/bin/svnrdump svnrdump
sudo ln -Ff /usr/local/bin/svnserve svnserve
sudo ln -Ff /usr/local/bin/svnsync svnsync
sudo ln -Ff /usr/local/bin/svnversion svnversion
I did this with Xcode 5.1 and SVN 1.8.8, haven't had any problems at all.
回答2:
- These are simply two different client applications.
You can set the path to XCode's subversion client by setting XCSubversionToolPath, e.g. (replace with actual svn 1.8 path):
defaults write com.apple.Xcode XCSubversionToolPath /usr/local/bin/svn
回答3:
The above solution ultimately did work for me for Xcode 5.1; I have shortened the code above, feel free to change your directories appropriately (e.g., since I am using MacPorts my svn binaries are in /opt/local/bin
):
export xcode_dir=/Applications/Xcode.app/Contents/Developer/usr/bin
export svn_files="svn svnadmin svndumpfilter svnlook svnrdump svnserve svnsync svnversion"
export svn_dir=/opt/local/bin
for f in $svn_files; do echo "sudo mv -v $xcode_dir/$f $xcode_dir/$f.bak && sudo ln -s $svn_dir/$f $xcode_dir/$f”; done | bash
In addition to this, try deleting your project.xcworkspace
if you are running into trouble after updating SVN, and make sure you are running the correct version of Xcode! (I was still running Xcode 5.1 BETA while attempting to validate changes I made to the Xcode.app directory... Stupid mistake but it took me a while to figure out)
来源:https://stackoverflow.com/questions/19177699/using-svn-1-8-3-with-xcode-5