Wednesday, November 07, 2012

How to use Cygwin svn and TortoiseSVN both, or fixing " Unable to open an ra_local session to URL" svn error

I have SVN repo located in C:/SVNrepo. And I have a working copy created with TortoiseSVN.
Sometimes I need to access my machine remotely with just command line. I use Cygwin SSH for this.
Sometimes in Cygwin bash session I need to use svn command, for example to update or commit my project working copy.
Well. It did not work. :(
The cause is that Subversion stores path to repository in working copy directory .svn. Inside this svn repo path is set by a tool that created the working copy. If the working copy was created by TortoiseSVN, the repo path will be DOS/Windows path - C:/SVNrepo. Or whatever path you have, important is that it is in DOS/Windows convention, it starts with a drive letter followed by colon.
Cygwin in general can honor such pathes. However its svn utility cannot.

For example it will fail if you issue:

$ svn ls file:///C:/SVNrepo
svn: E180001: Unable to connect to a repository at URL 'file:///C:/SVNrepo'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///C:/SVNrepo'


Cygwin's svn honors only Cygwin's path convention - /cygdrive/c/SVNrepo.

$ svn ls file:///cygdrive/c/SVNrepo
 project1/
 project2/

As you can see, the repo URL has three slashes in prefix - file:///
First two belong to the prefix itself - file://. The last slash means filesystem root.
It means that when ra_local library parses the URL 'file:///C:/SVNrepo' it will take out "file://" part, and try to find '/C:/SVNrepo' directory. And, of course, it fails! - there is no such path in my system.
Despite there is C:/SVNrepo, there is no /C:/SVNrepo.

What to do?!

To create a link!

ln -s /cygdrive/c /C:

check it is created

ls -l /
...
lrwxrwxrwx   1 mark           None     11 Nov  7 14:25 C: -> /cygdrive/c
...


ensure svn likes it

$ svn ls file:///C:/SVNrepo
 project1/
 project2/

It does!
It works now!





10 Comments:

Blogger Raymond DeCampo said...

I get around this by using the Windows native svn client instead of cygwin's svn client. Add it to your Windows PATH and it runs just fine from cygwin.

7:34 AM  
Blogger Camellia Canan said...


These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post. Your articles really impressed for me,because of all information so nice.

SAP training in Chennai

11:26 PM  
Blogger Keerthi said...

This idea is mind blowing. I think everyone should know such information like you have described on this post. Thank you for sharing this explanation.Your final conclusion was good. We are sowing seeds and need to be patiently wait till it blossoms.

Online Training in Chennai

4:09 AM  
Blogger Sathya G said...

the blog is very interesting and will be much useful for us. thank you for sharing the blog with us. please keep on updating.
ROI Services in Chennai

5:38 AM  
Blogger Sathya G said...

the site contains a very great article. the information present in this site will be very useful for us. thank you for sharing the blog with us.
ROI Services in Chennai

2:25 AM  
Blogger Suseela Susiee said...






What an awesome post, I just read it from start to end. Learned something new after a long time.



Cloud Computing training in Chennai

Salesforce training in Chennai

VMware training in Chennai

AWS training in Chennai

6:20 AM  
Blogger Suseela Susiee said...



What an awesome post, I just read it from start to end. Learned something new after a long time.



SAP ABAP training in Chennai

SAP FICO training in Chennai

SAP MM training in Chennai

SAP SD training in Chennai

1:54 AM  
Blogger Hammed said...

your blog is very interesting to see..thank you for share your blog to public....i read full content from your blog some points are nice to see..




digital marketing company in india

11:50 PM  
Blogger Jeffy said...

Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!!
seo company in india
digital marketing company in india
seo company in chennai
digital marketing company in chennai

6:51 AM  
Blogger sunitha vishnu said...

It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

1:03 AM  

Post a Comment

<< Home