Subversion path differences for svn and svn+ssh

13,724

Solution 1

As womble have said, indeed this is the 'feature' of svn over ssh.

I had svn+ssh working without specifying the full path to repositories because the svn server had a svnserve wrapper script in place of original svnserve binary. Later, during subversion update this script was overwritten by the original binary.

Solution:

  1. Rename svnserve to bin

    mv /usr/bin/svnserve /usr/bin/svnserve.bin
    
  2. Save this script as /usr/bin/svnserve:

    #!/bin/sh
    exec /usr/bin/svnserve.bin -r /srv/svn "$@"
    
  3. Update permissions

    chmod 755 /usr/bin/svnserve
    

Solution 2

That's because svn over SSH (svn+ssh://) is just accessing a subversion repository "locally", using SSH as the transport, and hence you have access to the entire filesystem. Svnserve, in contrast, is told "start your paths with /srv/svn, and so you don't have to specify it manually.

Solution 3

You can edit the ssh login command for users using svn+ssh, by editing the ~/.ssh/authorized_keys of the subversion user. The line for a user will looks like :

command="/usr/bin/svnserve -r /srv/svn [other svnserve options]" <key type> <user key> <key comment>

There are more svn+ssh tricks in the svn book

Share:
13,724

Related videos on Youtube

user1807902
Author by

user1807902

Careers 2.0 LinkedIn

Updated on September 17, 2022

Comments

  • user1807902
    user1807902 over 1 year

    [02:48][root@server:~] ps ax | grep svn 23986 ? Ss 0:00 /usr/bin/svnserve -d -r /srv/svn As you see from arguments my svn root dir is /srv/svn.

    Now, some magic from remote machine...

    This works:

    > svn co svn://[email protected]/test-repo
    

    But this not:

    > svn co svn+ssh://svn-user@<putty-session-name>/test-repo
    'No repository found in 'svn+ssh://svn-user@<putty-session-name>/test-repo'
    

    Playing around for couple of hours I've found that appearantly if I use ssh tunnel, I'm able to get my repo using following:

    > svn co svn+ssh://svn-user@<putty-session-name>/srv/svn/test-repo
    

    ...which means that I should specify full physical path to the repo. Huh?

  • user1807902
    user1807902 over 14 years
    Thank you for your opinion, but no, it is not. Everything was working lovely until I had everything screwed up, as usually.
  • womble
    womble over 14 years
    Well, then, fix whatever you screwed up.
  • user1807902
    user1807902 over 14 years
    You're right, womble. Seems I've found where the problem was.
  • user1807902
    user1807902 over 13 years
    You didn't read my answer correctly. You should rename svnserve binary to svnserve.bin, and save the wrapper script you have there as svnserve. Or simply, contents of both your files should be swapped.
  • mox601
    mox601 over 13 years
    I think that calling svnserve.bin from authorized_keys2 and in that file executing svnserve should be exactly the same, isn't it? I did like that to prevent renaming svnserve binary, do you think it is wrong?
  • Bot
    Bot over 13 years
    I had the same issue except reverse. I spent hours trying to figure out why i couldn't do svn+ssh://host/path/to/repo because I had a script being ran that automatically directed me to the svn root. All I needed to do was svn+ssh://host/repo.