5

I have a working repository that I created a long time ago, and now I'm trying to set up another, but I'm having great difficulty. Here's what I did to create the second one; and I would expect this to work:

U:\repos>svnadmin create repo1
U:\repos>echo password-db = passwd >> repo1/conf/svnserve.conf
U:\repos>echo auth-access = write >> repo1/conf/svnserve.conf
U:\repos>echo user1 = user >> repo1/conf/passwd
U:\repos>cd repo1
U:\repos\repo1>svnserve -d

And in another terminal:

U:\>mkdir wc
U:\>cd wc
U:\wc>svn co svn://localhost/repo1
svn: E210005: Unable to connect to a repository at URL 'svn://localhost/repo1'
svn: E210005: No repository found in 'svn://localhost/repo1'
U:\wc>

The other repository is configured in the same way at u:\repo. What's going on?

bahrep
  • 26,679
  • 12
  • 95
  • 136
lmat - Reinstate Monica
  • 6,119
  • 4
  • 44
  • 55
  • 2
    It might be worth to look into alternatives like http://www.visualsvn.com/ which are very easy in use, setup is done in a few clicks and creating and managing repositories also. I know this is a little bit off your question, but still as a comment it can't hurt much to add it. :) – Viezevingertjes Mar 12 '13 at 15:22
  • 1
    @MrMichael Excellent comment, and welcome. I was going for a command-line only (and svn-tools-only, that is, no third-party) solution because I want something very portable, small, no install, _etc_. – lmat - Reinstate Monica Mar 12 '13 at 15:23
  • 2
    @MrMichael *Portable? Small? No install?* Do you know that you can access Subversion repository without any server? I.e. you can access a repository directly on disk via `file:///URL`. http://svnbook.red-bean.com/en/1.7/svn.serverconfig.multimethod.html – bahrep Mar 20 '13 at 08:20
  • @bahrep Old news, still most people prefer eyecandy and simple management in stead of commandline tools. For me personally SVN won't do the trick, it does not offer the features i demand from source control, which Mercurial/Git do offer. – Viezevingertjes Mar 20 '13 at 13:18
  • @MrMichael Ehm. Looks like I understand your point. However I don't understand how it relates to my comment :)) – bahrep Mar 20 '13 at 13:21
  • @bahrep I was trying to say that not everyone is comfortable with commandline tools, so i just threw it in as a suggestion if someone is struggling. Also, i did not say "Portable? Small? No install?" that was the poster although i would not think of SVN with that criterea, unless working alone. :P – Viezevingertjes Mar 20 '13 at 14:30
  • @bahrep Was your first comment aimed at me? Thanks for that info; I was only vaguely aware of this feature. I do plan on disconnecting from the repository on a regular basis, so a working copy is fairly essential. As you see from the answer, I got it set up; thanks again! – lmat - Reinstate Monica Mar 20 '13 at 16:40
  • 1
    @LimitedAtonement Eek! Yep, it was aimed at you but I missed xD – bahrep Mar 20 '13 at 16:43

1 Answers1

4

First, cd repo1 is superfluous: svnserve doesn't care about the working directory in this instance.

To make your example work, change -d to -d -r \repos.

Alternatively, you could change your co command to svn co svn://localhost/repos/repo1.

When svn co is run, it's using the URL to tell svnserve where to look for the repo. This path by default is relative to /, not the working directory where svnserve was launched! The existing repository works because the repo happens to be in /, not because svnserve was launched from /repo. When you want the path of your repo to be referenced from somewhere other than /, use the -r [--root] option of svnserve.

This means that a repository stored at u:\repos\repo1, when launched with svnserve -r u:\repos must be referenced by the url /repo1 (svn://localhost/repo') rather than /repos/repo1. Capish?

lmat - Reinstate Monica
  • 6,119
  • 4
  • 44
  • 55