Setting Up a Local Subversion Server

From EDM2
Revision as of 23:10, 7 October 2018 by Ak120 (Talk | contribs)

Jump to: navigation, search

Setting up a local Subversion server

This is a very quick guidance to get a local subversion server up and running on an eCS box. You can call it subversion server for dummies. There's a lot of in depth information available on the net about svn servers and you should consult these for more information. But if you want to have your local server up and running within 15 minutes, simply follow these steps:

  • Get the latest svn package from Paul's site and unpack it in a folder of your choice

At this time this is Subversion 1.6.4 - updated 2009-08-10. Read the readme and make sure you have libc063.dll installed which is the case with every modern eCS installation. You can add the \bin subdirectory to your PATH statement in config.sys, but this is not necessary.

  • Insert svn ports in x:\mptn\etc\service (where x: is your boot drive)

Add in your service file the following lines:

svn           3690/tcp   # Subversion
svn           3690/udp   # Subversion

I'm not sure if this is really necessary but at least it's handy if you want to check your svn server with telnet (telnetpm localhost svn)

  • Create a repository

Create a directory where the svn information for all your projects should end up. This should be on a data partitions. f.i. all my private data are on drive E:. This is also the drive where I make backups regularly. So I chose 'E:\svn\repos' as my svn base directory. Change all references below to your own directory.

Use svnadmin.exe from the \bin directory to create the repository.

svnadmin create --fs-type fsfs e:\svn\repos

creates various sub-directories below e:\svn\repos. Usually there's no need to edit the files here manually, you can use svnadmin instead. Some exceptions are stated below.

  • Allow users to connect to your svn server

Edit e:\svn\repos\conf\svnserve.conf and unmark the lines:

anon-access = read 
auth-access = write
password-db = passwd

Edit the file e:\svn\repos\conf\passwd. In the user section add your users and passwords if required:

[users]
# harry = harryssecret
# sally = sallyssecret
user1 = pwd
anotheruser = 

Note user1 have to login with the password pwd, anotheruser can login without password.

  • Start the server daemon

Create a directory for a logfile if needed f.i. 'e:\Log\subversion\'

Start the server daemon with

svnserve -d -r e:\svn\repos --foreground -T --log-file e:\Log\subversion\svnserv.log

From now on users can access projects created below 'e:\svn\repos'. A logfile called svnserv.log about svn transactions is written into directory e:\Log\subversion\.

Alternatively if you like to start the svn server every time your machine reboots you can create a reference from svnserve.exe to your startup folder with parameters -d -r e:\svn\repos --foreground -T --log-file e:\Log\subversion\svnserv.log and as working directory the \bin where you extracted your subversion files

  • Import your first project into the svn repository

Caution - clean up your project tree before importing anything to the repository. Or better make a copy of your project directory and delete all files which are not really necessary for building your project. Especially all 'bin' files (like *exe, *obj, *dll) and all backup sub-directories. Files which are imported to the repository can not be deleted afterwards. Of course you can make another 'check in' and 'delete' unnecessary files so that they are ignored on later checkouts, but the repository have to keep the originally 'imported' files forever. That's the purpose of a svn/cvs server - to keep all older versions in the repository too. Of course you can add files afterwards so better import less than to much files at first.

svn import e:\_work\project1 file:///e:/svn/repos/eCS/test/project1/trunk -m "First Import"

Imports the whole tree below e:\_work\project1 into the repository which then can be accessed as svn://localhost/eCS/test/project1 (change localhost to the computers ip-name or ip-address when accessing from other machines on your LAN). The 'check in' comment is set to 'First Import' in this example. Use forward slashes in the repository path as shown above

You can check your projects in your local repository with svnlook tree e:\svn\repos

  • Access your repository

Use your favourite svn client to access your repository. I suggest SmartSVN 6.0.7. I've used 2.1.3 successfully in the past too. 6.0.4 and 6.0.5 have nasty problems on eCS. If you want to access your repository from Windows machines, tortoise maybe a good choice.

Point the repository browser to svn://loacalhost/ to browse your projects.

Most of the steps above including creating the repository can be handled from the SmartSVN GUI too. Repository - Set Up Local Repository.. let you create your repository and users in a GUI fashion. If you create a User within SmartSVN without a password SmartSVN inserts null as password. But you can correct this by manually editing 'e:\svn\repos\conf\passwd' of course.

Links