Getting the SVN Service to work on Vista

Since I'm thinking of moving from SVN to a distributed version control system, the first thing I need to do is to try to convert my current repositories to the other version control systems and the first one I tried was git.

My repositories are local and I access them via "file://...", and apparently the "git-svn" application can't access the repositories that way, so I had the get the my repositories to work via the "svn://" protocol.

Step 1: Register the SVN service
To register the "svnserve" executable as a windows service we run the following command (in a command prompt window with administrator rights):

sc create svnserve
binpath= "\"{Path to svnserve.exe}\"
--service -r {Path to your repositories}
displayname= "Subversion Server"
depend= Tcpip
start= auto

Where the "{Path to your repositories}" variable should be the path that contains the repository, not the repository itself, for example if you have three repositories:
  • c:\repositories\dev
  • c:\repositories\university
  • c:\repositories\work
you should put "c:\repositories" as the path to your repositories.

Step 2: Add the "mylocal" host to your hosts file
You'll notice that I added the "--listen-host=mylocal" to svnserve's arguments, the reason for that is that for some reason you can't access the server using TortoiseSVN and other tools unless they use a host that's not localhost (I'm not sure why that is, but that's how this guy solved the problem).

For this to work you have to define the "mylocal" host in your hosts file, to do that just add the line " mylocal" to the "C:\Windows\System32\drivers\etc\hosts" file.

Step 3: Start the service
Run "services.msc", right click on the "Subversion Server" service and press "Start".

Step 4: Test the server
Open a command prompt and run:

svn info svn://mylocal/{path-to-svn-repository}

If it writes some information about that repository then it works!

Now open the same path in TortoiseSVN's repository browser.


salty-horse said…
A bit late... but:

git-svn seems to work fine with local repositories on linux.
For example, after initializing a repository in /tmp/svn/test I managed to fetch it with git using this command:

$ git svn clone file:///tmp/svn/test/ -std-layout

Admittedly, it's on linux, but it should work on windows. (git-svn is in perl and requires some SVN-related modules from CPAN).

If you want to try another method of converting the repository, try Tailor. It can convert between all the popular VCSs.

Popular posts from this blog

Restart the Windows File Sharing Service to fix weird problems

WPF, ImageSource and Embedded Resources

SharpDevelop dark color scheme