Search code examples
svnsvnadmin

svn: Local URL 'file://xxx.xxx.xxx.xxx/root/svn_repo' contains unsupported hostname


I'm using svn and svnadmin of v1.6.13.

[root@ns ~]# pwd
/root

[root@ns ~]# svn --version
svn, version 1.6.13 (r1002816)
   compiled Oct 11 2010, 08:18:53

[root@ns ~]# svnadmin --version
svnadmin, version 1.6.13 (r1002816)
   compiled Oct 11 2010, 08:18:53

I created a local repository

[root@ns ~]# svnadmin create svn_repo

then I checked out this repo

[root@ns ~]# svn co file://192.168.xxx.xxx/root/svn_repo
svn: Unable to open an ra_local session to URL
svn: Local URL 'file://192.168.xxx.xxx/root/svn_repo' contains unsupported hostname

There is no version issue because both version are the same.

Websvn is not needed, and command line is just enough for me.

How to fix it?


Solution

  • Read the docs about proper defining URL with file protocol!!!

    SVN URL has the following format: (protocol)://(servername)/(path)

    • (protocol) is a way of connecting to SVN server.
      • file - the repository is located in a local or network file system.
      • svn - native (internal) protocol realized by the svnserve daemon.
      • svn+ssh - the same as svn, but with access through the SSH (Secure Shell). Allows to transmit encoded data.
      • http - protocol enabling access to SVN services through the apache web server. In this case SVN is an apache module. Its advantage over svn protocol is data transferring according to standard http-protocol and absence of problems with firewalls. https - similar to http, but with encoded data transmission.
    • (servername) - a server name for client-server protocols. For the file protocol it is empty, and SVN URL looks like file:///(path_on_local). That is, SVN URL contains 3 slashes one after another.
    • (path) - a path at the server or at the local disk.

    Your local repo must be addressed as file:///root/svn_repo