Here is my recipe to create a simple Mercurial server and sharing the source using SCM-Manager.
Why using SCM-Manager instead of the standard ssh access for Mercurial? The main reason is for simplicity. SCM-Manager makes it easy to create users, groups and share repositories through http/https protocol.
For this setup, I use a Turnkey Virtual Machine because they are small (they need only 256 Meg of Ram) and well configured.
What you need before starting? A computer with Virtual Box and some Linux knowledge.
VM installation
- Go to http://www.turnkeylinux.org/core and download the “OVF” version of the virtual appliance.
- Import the “OVF” image in Virtual Box
- I suggest to rename the VM, for example: “SCM-Manager”.
- Start the VM and answer some simple questions.
Once the VM is started, you have to log in using an SSH client or using the VM’s console in Virtual Box.
Mercurial and SCM-Manger installation
- Add the “non-free” repository, we will need it to install Oracle’s JVM:
vi /etc/apt/sources.list.d/sources.list
Change:
# deb http://ftp.debian.org/debian squeeze non-free
for:
deb http://ftp.debian.org/debian squeeze non-free - Update the software list:
apt-get update - Upgrade the installed packages:
apt-get upgrade - Install some tools that will let us install/run Mercurial and SCM-Manager:
apt-get install python python-dev python-docutils build-essential sun-java6-jre - Download Mercurial source:
Look for “Mercurial x.x source release” at http://mercurial.selenic.com/downloads/ - Install Mercurial:
At the time of writing, the latest release of Mercurial was 2.4. I like to install my software in /usr/local/soft/softwareName-version/run, so I compiled and installed mercurial in the appropriate folder using this command:
make install PREFIX=/usr/local/soft/mercurial-2.4/run
SCM-Manager installation
- Follow the “Install SCM-Manager” procedure at:
https://bitbucket.org/sdorra/scm-manager/wiki/getting-started - Start SCM-Manager (see previous point).
- Configure Mercurial Settings:
Configure the “Mercurial Settings” for your own installation. I only have to change the “HG Binary” and the “Python Module Search Path” paths. - Once everything is working well, you can add a service that will start SCM-Manager automatically.
PS:
Turnkey offer a “Revision Control” VM (http://www.turnkeylinux.org/revision-control) with Mercurial already installed why do we not choose that VM?
I prefer to use their “Core” VM (http://www.turnkeylinux.org/core) and install myself the latest release of Mercurial because the version provided on the “Revision Control” VM was giving me trouble with SCM-Manager.