Posts Tagged ‘SVN’

Upgrading the Subversion command line client on Mac OSX Leopard

Wednesday, May 20th, 2009

OSX Leopard ships with Subversion 1.4.x by default. Since then, SVN has had 2 major upgrades (merge tracking anyone?). To make things easy, there is a binary availableĀ atĀ Collab.net. But unfortunately you need to do some work yourself.

The path of the built in Subversion command line client is different to the one that the Collab.net Community binary is installed to. The following steps will fix this.

Disclaimer – Be careful: when you use the Terminal you are flying without a safety net! No undo & no restore from trash. Do this at your own risk and don’t forget to have an up-to-date backup!!!

  1. install the binary downloaded to Collab.net
  2. open your Terminal and check which version of SVN you are using by typing svn --version. This should say 1.4.x
  3. check which installed instance of SVN the OS is using by typing which svn. This will return the path to the SVN version you are using, which probably is /usr/local/bin/svn
  4. check whether the Collab.net version is installed by going to it: cd /opt/subversion/bin. Doing an ls should show you the subversion files
  5. Backup the current svn location: by going to it (cd /usr/local/bin) and copying it to your desktop or wherever you fancy (mv svn* ~/Desktop/)
  6. now you need to create symlinks to the Collab.net binaries:
    • ln -s /opt/subversion/bin/svn svn
    • ln -s /opt/subversion/bin/svnadmin svnadmin
    • ln -s /opt/subversion/bin/svndumpfilter svndumpfilter
    • ln -s /opt/subversion/bin/svnlook svnlook
    • ln -s /opt/subversion/bin/svnserve svnserve
    • ln -s /opt/subversion/bin/svnsync svnsync
    • ln -s /opt/subversion/bin/svnversion svnversion
  7. That should be it

The beauty is that you only need to do this once. The next time you upgrade your Subversion client, the symlinks will just point to the updated files and everything should be fine. As I said earlier though: only do this if you feel comfortable on the command line.

UPDATE: I have been told that some people seem to have SVN installed in /usr/bin/. Just use the path that is returned by the which svn command. You might also need to use sudo to run some of the command (i.e. move).

TextMate & Subversion 1.5 update problem with conflict

Tuesday, October 28th, 2008

We recently upgraded to Subversion 1.5 server at BBC Worldwide. I ended up upgrading my client at the same time with the latest OSX binary from Colabnet.
One weird thing started to happen though: whenever there were conflicts, TextMate wouldn’t allow me to use the ‘Resolve Conflicts with FileMerge…’.

Long story short: the interactive mode keeps TextMate from getting all the data so you don’t get the .rxxx & .mine files which are needed for FileMerge to show you the differences.

To fix this is:

  1. go into your TextMate Subversion Bundle
  2. go to the ‘Update to Newest (HEAD)’ command and add
    --non-interactive after '#{svn}' update

You can see the resulting code here (change on line 14).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require_cmd "${TM_SVN:=svn}" "If you have installed svn, then you need to either update your <tt>PATH</tt> or set the <tt>TM_SVN</tt> shell variable (e.g. in Preferences / Advanced)"
 
"${TM_RUBY:-ruby}" -r "$TM_SUPPORT_PATH/lib/shelltokenize.rb" <<END
	svn = ENV['TM_SVN'] || "svn"
	ruby = ENV['TM_RUBY'] || "ruby"
	support = ENV['TM_BUNDLE_SUPPORT']
	paths = TextMate.selected_paths_array
 
	# TODO: Ideally, we'd like to use a tooltip for one and not others, but we can't switch from a tooltip
	# to dynamic HTML output (or maybe we could double-fork a process?)
	# if ((paths.size == 1) and not (File.directory? paths[0]))
	#	puts %x{#{svn} update #{TextMate.selected_paths_for_shell}}
	# else
		update = IO.popen("'#{svn}' update --non-interactive #{TextMate.selected_paths_for_shell}", 'r')
		format = IO.popen("'#{ruby}' -- '#{support}/format_status.rb'", 'w')
		update.each_line { |line| format.puts(line) }
	# end	
END
 
# force TM to refresh the current file..
rescan_project