SVN on Mac
Having bought a Mac, I was puzzled by installing the software on it, which was previously on my PC. Almost everything was transferred. For some reason Makovsky versions were found, for some they managed to find a replacement. Problems arose with Subversion (SVN). On a PC, I used Visual SVN Server, which requires virtually no configuration and works immediately after installation. There was no such pleasure on the Mac, so I had to tinker a bit.
So here is what I did:
- There are several SVN builds for Mac OS X. I chose the version from MacPorts for myself. There were a number of reasons. The latest version is offered there. In addition to SVN, many other useful Open Source projects are available through MacPorts. Including, for example, MySQL, which I also need. You can download MacPorts from here .
After loading the dmg file, mount the image if it was not mounted automatically. Then run the pkg file, which is inside. MacPorts will install on your computer. - After installation, it is advisable to check for updates. To do this, enter in the terminal:
sudo port -v selfupdate
If a new version is available, then an update will occur. If you downloaded the latest version, you can skip this step. - Download SVN. To do this, enter in the terminal:
sudo port install subversion
This will take some time. At the end, SVN will be installed. All necessary variables will be added to PATH. You can test the installation by typingsvn --version
Something should appear:svn, version 1.5.6 (r36142) compiled Mar 14 2009, 20:50:37 Copyright (C) 2000-2008 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_neon: Module for accessing a repository via WebDAV protocol using Neon. - handles 'http' scheme - handles 'https' scheme * ra_svn: Module for accessing a repository using the svn network protocol. - with Cyrus SASL authentication - handles 'svn' scheme * ra_local: Module for accessing a repository on local disk. - handles 'file' scheme * ra_serf: Module for accessing a repository via WebDAV protocol using serf. - handles 'http' scheme - handles 'https' scheme
- Now you need to transfer your repositories from the PC. To do this, I created the Repositories folder in the root of the system drive and copied all the repositories from the PC there. If you did not have repositories before, then you can create them with the svnadmin create command. For example
svnadmin create /Repositories/MyRepo
. I will not describe in detail the process of creating a repository. You can see it here . - Starting an SVN server is simple, for this you need to enter in the terminal
svnserve -d -r <путь к репозиториям>
In our case:svnserve -d -r /Repositories
This command starts the SVN daemon. After that, you can access the repositories over the network. For example, like this:svn://svnserver/MyRepo
- Now we pass to the most interesting. I fiddled with this the longest. The problem is that the SVN server does not start automatically when the computer starts. You can fix this with launchd, the standard Mac startup method. To do this, create the file
/Library/LaunchAgents/org.tigris.subversion.svnserve.plist (you can choose a name as you like):Disabled Label org.tigris.subversion.svnserve Program arguments / opt / local / bin / svnserve --inetd --root = / repositories ServiceDescription Subversion standalone server Sockets Listeners Sockfamily IPv4 SockServiceName svn Socktype stream Sockfamily IPv6 SockServiceName svn Socktype stream inetdCompatibility Wait
It is important to specify the full path to svnserve. In my case, it is / opt / local / bin / svnserve. Without this, everything will work crookedly. If you do not need IPv6 configuration, then the corresponding dict block can be deleted.
Then, the following commands are entered in the terminal to activate the configuration:launchctl load org.tigris.subversion.svnserve.plist (if you chose a different name, enter your own) start org.tigris.subversion.svnserve
exit to the terminal
That's it. After that, everything worked for me. This autostart method does not start the daemon, but uses inetd. The advantage of this method is that the process starts only when accessing the corresponding port. The system also deletes the process from memory when it sees fit. What is good.
I hope this short instruction saves you a lot of problems. :)