Using Mercurial with Codebeamer
Mercurial Overview
Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects.
Codebeamer has out-of-the-box support for mercurial repository access, for both 'external' or 'managed' repository configurations.
Installing Codebeamer with Mercurial
In the Codebeamer Windows versions, Codebeamer is shipped with Mercurial and no installation is necessary unless access via Apache is required.
1. Download Mercurial from http://www.selenic.com/mercurial/wiki/index.cgi/BinaryPackagesor use the mercurial Linux package.
* 
On Windows we recommend using one of the EXE installers because we experienced some problems when using the MSI ones.
2. Install Mercurial (this is done by the package manager on Linux). See Mercurial wiki for help.
4. Start Codebeamer.
At this point Codebeamer and Mercurial should be working together and you should be able to create Codebeamer projects with a managed Mercurial repository. The whole process takes about 10-15 minutes.
* 
There is no managed ACL (Access Control List) support for directories in Codebeamer for Mercurial, so authenticated users can access any content under a repository. If necessary, one can maintain ACL by the built-in ACL extension of Mercurial.
The Mercurial server component in Codebeamer is called hgserve (supports only cloning) and it is started and stopped automatically by Codebeamer.
Mercurial Client on Windows
On a Windows platform additional setup is necessary to use Mercurial over SSH.
First generate an SSH keypair as described in Setting Up SSH Authentication for Git and Mercurial.
Modify the Mercurial setup to use your ssh client command in global configuration (mercurial.ini under your home):
[ui]
...
ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "C:\Documents and Settings\adam.berkes\key.ppk"
...
* 
There are certain versions of putty which fail to communicate this way, so we advise using the plink program from TortoiseHg. If you do this don't forget to modify Mercurial.ini in the installation directory of TortoiseHg (by default C:\Program Files\TortoiseHg\Mercurial.ini) as well.
Using Mercurial in the Eclipse IDE with the MercurialEclipse plugin
MercurialEclipse is the most commonly used IDE integration plugin. Using it for development with Codebeamer Managed Mercurial Repositories is easy. For download information visit http://javaforge.com/wiki/72561#download .Learn more about using Mercurial with Codebeamer under Eclipse IDE in this page.
URLs of Managed Mercurial Repositories
Mercurial can be configured three ways in connection with Codebeamer:
1. Hg own sharing (serve).
2. Apache http/https access.
3. Ssh access to commit changes and public read access.
4. Mix of the previous two approaches.
If hg serve is turned off in Codebeamer's configuration (i.e. general.xml, see Sharing Managed Repositories) the Apache server can be setup according to Configuring Apache for Mercurial section.. In this case only members with SCM_VIEW permission can read (clone/pull) project repository and only members with SCM_COMMIT permission can write into it (push). Codebeamer maintains repository access configuration information however additional restrictions can be applied in Apache configuration if necessary. For example:
http://javaforge.com/hg/hgeclipse
If Apache is not configured but hg serve is started by the Codebeamer server and OpenSSH is installed on the server then all users have public read access to the repository (default port: 8000) but only users with SCM_COMMIT permission have write access to it (e.g. push). System Administrators can also run remote hg commands. OpenSSH is officially supported only on Linux platforms however it can be set up using Cygwin on Windows. Examples:
Repository read access example: http://localhost:8000/myrepositoryname
Repository read-write access example: https://javaforge.com/hg/hgeclipse
Repository read-write access example: ssh://codebeamer@javaforge.com/hgeclipse
The above scenarios can be mixed if both Apache and OpenSSH are configured. Authors can send their changes through SSH or HTTPS, while HTTP access is restricted to only certain members.
Useful Mercurial Commands
Was this helpful?