SVN over SSH in Zend Studio for Eclipse

This should be pretty damn straight forward. However i ran into some problems while setting this up. At my daily work spot we use SVN over HTTP so we can do NTLM authentication. This sucks in many ways. But most of all it’s slow. And i mean really slow. Last week i tried to retrieve the log information for a project in the repository. This took my IDE 30 minutes. At first i thought my IDE was just being lame on me. But it turns out it’s SVN over HTTP that’s the culprit.

So i started to do some testing over the standard svn:// protocol. And retrieving the logs on the same repository took about 2 seconds. Amazing. That’s enough reason to switch to the svn:// protocol. This however was not possible. Because our network policy doesn’t allow for multiple log ins. All is centrally stored on some M$ domain controllers. That’s why SVN over HTTP was used in the first place. End of story i thought.

But i couldn’t let go of this. The situation becomes less workable every day. So i decided to look around for other options. When i notice some log ins were merged to the *nix boxes. i immediately thought about using SSH in combination with SVN. Logging in on the *nix box was no problem. So let’s try that with SVN.

svn+ssh://location/of/repo

This gives an error about a mismatched handshake. And i just couldn’t get this to work until i found a post made by Martin Woodward. He explains how to setup an environment variable on my local windows machine. To the tortoise PLink executable.

Set the environment variable (by right-clicking on My Computer, Properties, Advanced, Environment Variables, New):-
Variable name: SVN_SSH
Variable value: C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe

This seemed to work i thought. i was presented with a login box. But no matter how i tried i couldn’t login. It just kept giving me the login box. So i opened a SSH session to the server and tried to do the same from there.

svn list svn+ssh://location/of/repo

After hitting enter i typed my password and got the following message.

bash: line 1: svnserve: command not found
svn: Connection closed unexpectedly

Now we’re getting somewhere. So svnserve could not be found. Probably because it’s not in the $PATH variable. So let’s add it there.

vi .bashrc
PATH=$PATH:/usr/local/bin

So let’s try to get a listing of the repo.

svn list svn+ssh://location/of/repo

This gave me the following message:

svn: No repository found in ‘svn+ssh://location/of/repo’

Seems that when you use SVN over SSH you need to give the full location to the repository. Not the web server path but the complete file system path. After changing the webserver path for the file system path everything worked out. From here on adding the repository to eclipse is easy.
I always open the repository view. From there i right click > New > repository Location. The URL to add will look something like

svn+ssh://file/system/location/of/repository

So now we can enjoy the speed of the svn:// protocol. And the security of SSH. So let’s do some coding :)

3 Responses to 'SVN over SSH in Zend Studio for Eclipse'

Subscribe to comments with RSS or TrackBack to 'SVN over SSH in Zend Studio for Eclipse'.

  1. So you actually got it working now eh?
    We use tortoise with plink for ssh.
    The thing is when you connect to a secure server with svn+ssh the prompt for your password shows up every time you open a new sub folder.
    Maybe Zend studio has a solution for this?

    btw: i hope you get better soon.

    Bart

    3 Sep 08 at 02:54

  2. Hey Bart :)

    I know it prompts for a password every time. But it’s pretty easy to solve. Just configure SSH to allow connections based on keys and not on passwords :) When that’s setup you never need a password again. Unless the server signature changes.

    btw: I hope so too… Hope i will be back tomorrow.

    Thijs Lensselink

    3 Sep 08 at 03:45

  3. Found this on Google and just wanted to point out that slowness from using SVN over HTTP could be related to not having KeepAlive enabled on the web server. Just a thought for those who might still have to use HTTP(S) and land on this page like I did. :)

    Ken

    16 Dec 08 at 15:32

Leave a Reply

 
Stop ACTA