Subversion 1.5/1.6 and Xcode 3+ HOWTO
Subversion 1.5/1.6 and Xcode 3+ HOWTO
- Subject: Subversion 1.5/1.6 and Xcode 3+ HOWTO
- From: Kyle McKay <email@hidden>
- Date: Sat, 21 Mar 2009 00:01:32 -0700
I recently began using Subversion 1.5.5 with Xcode 3.1.2 and after
some searching for how to make it work, ended up doing something
different (and I think much simpler) than the instructions I found.
I'm sharing my configuration in case someone else finds it helpful.
------------
INSTALLATION
------------
1. Fetch a Subversion installer for Mac OS X from:
http://downloads.open.collab.net/binaries.html
The most recent installer can be found on that page. If you would
prefer an older installer (1.5.6 for example because you're not ready
to jump on the 1.6.0 bandwagon just yet) you can choose from all the
available Mac OS X installers at:
http://svnbinaries.open.collab.net/servlets/ProjectDocumentList?folderID=164
2. Mount the .dmg you just downloaded and install the package. (Most
everything installs into /opt/subversion except for a few symbolic
links that are placed into /usr/local/bin.)
-------------
CONFIGURATION
-------------
3. Configure your environment so Xcode 3+ will find the new
libraries. Do this from a Terminal prompt:
# NOTE: The following line has been wrapped
# onto two lines by using the \ line
# continuation character
defaults write ~/.MacOSX/environment \
DYLD_LIBRARY_PATH /opt/subversion/lib
4. If you might want to also use Xcode 2.5 with the newly installed
Subversion then do this from a Terminal prompt:
# NOTE: The following line has been wrapped
# onto two lines by using the \ line
# continuation character
defaults write com.apple.Xcode \
XCSubversionToolPath /usr/local/bin/svn
5. For #3 to take effect YOU MUST LOG OUT AND LOG BACK IN (you don't
have to restart, just log out).
6. There is no 6. You're done. Assuming you've logged out and back
in since doing #3, Xcode 3 and later will now use the just-installed
version of Subversion.
7. You're already done with the Xcode portion of this exercise.
However, if you want to use the new version of Subversion you just
installed from the command line by just typing "svn" instead of "/usr/
local/bin/svn" everytime, you should make sure that either /usr/local/
bin or /opt/subversion/bin is in your PATH and that it's IN FRONT OF
the /usr/bin directory in your PATH.
-----
BONUS
-----
I like to keep my ~/.MacOSX/environment.plist file in human-readable
text format. After #3 above (or the removal instructions below) it
will be in binary plist format. To convert it back to text format, do
this from a Terminal prompt:
plutil -convert xml1 ~/.MacOSX/environment.plist
---------
UNINSTALL
---------
To remove, follow the "Uninstallation Notes" from the Subversion
installation package:
"To uninstall the Subversion Universal binary, just remove the /opt/
subversion directory and unlink all symlinks in /usr/local/bin
pointing to /opt/subversion/bin."
then delete the two defaults keys:
defaults delete ~/.MacOSX/environment DYLD_LIBRARY_PATH
defaults delete com.apple.Xcode XCSubversionToolPath
NOTE: You don't have to logout for this to take effect if you've
removed the /opt/subversion directory.
----------------------
MERGE TRACKING SUPPORT
----------------------
Presumably you want to use Subversion 1.5/1.6 for the excellent merge
tracking capabilities. In order to prevent clients without merge
tracking support (i.e. versions 1.4 and earlier) from being able to
commit changes without merge tracking information (and thereby
hindering use of the merge tracking support), you need to add a start-
commit hook to your repository to prevent pre-1.5 clients from being
able to commit.
Add the following start-commit script to the hooks subdirectory of
your repository:
---------- CUT HERE ----------
#!/bin/sh
case ":$3:" in *:mergeinfo:*) :;; *)
echo 'A version 1.5 or later client (mergeinfo support)' \
'is required to commit' >&2
exit 1
esac
exit 0
---------- CUT HERE ----------
For example, if you had done "svnadmin create /tmp/foo" to create your
Subversion repository, then you would need to create the start-commit
file as "/tmp/foo/hooks/start-commit" with the contents from between
the CUT lines above and then make sure it has read and execute
permissions for everybody with the "chmod a+rx /tmp/foo/hooks/start-
commit" command.
I have used the above method successfully with Xcode 3.1.2 and
Subversion installers from open.collab.net for version 1.5.5, 1.5.6
and 1.6.0 of Subversion.
Kyle
P.S. Some lines meant to be entered in the Terminal or in a shell
script have been wrapped using the \ line continuation character to
(hopefully) avoid getting mangled by gratuitous wrapping courtesy of
the email / mailing list software. You can use these lines as is --
when you press return after the \ you will be prompted for the rest of
the line -- or you can manually unwrap them (remove the \ and then
place the contents of the following line where the \ was).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden