Mercurial Guide

We're using Mercurial as our distributed version control system. Read the introduction to Mercurial for a better understanding what Mercurial is and how it works. Also, visit their Wiki.

Contents

Get the source

If you want to get the sources, you need to install Mercurial on your computer, too. TortoiseHG is a GUI for Mercurial which makes using Mercurial much more comfortable. The TortoiseHG website describes how to install it. It's usage is pretty similar to TortoiseSVN and Co. If you just want to download the OpenClonk source code, you can also install Mercurial without TortoiseHG.

After installing Mercurial, you have to clone the repository. Use the TortoiseHG dialog to clone
http://hg.openclonk.org/
or execute this command in a commandline shell:
hg clone http://hg.openclonk.org/ openclonk

If you already cloned the repository and only want to update your local repository, use the Synchronise dialog of TortoiseHG to pull the repository and update. Or execute in the commandline:

hg pull --update

If you are using Windows, the first part of this tutorial will guide you through the steps required to get the sources.

Two tips for somebody new to Mercurial: Ignore the revision numbers, they are only there to mislead you. Pay attention to the changelog id. And activate the "Mercurial Queues" extension to get the "strip" command, with which one can delete changesets that are no longer needed.

Contribute changes

What you got to do is to make the changes in your working copy of the repository. Then, you commit the changes to your local Mercurial repository and after that export them as a patch (if you only changed source code or text) or as a bundle (if you changed binary files). You can show your piece of code to one of the people with write access to our repository by posting it in the forum. We'll have a look at the changeset and determine if your changes are fit for incorporating them into the source tree.

Miscellaneous

Mercurial extensions you really need

Add these to your ~/.hgrc (Linux) or %HOMEPATH%/Mercurial.ini (Windows) into the [extensions] section (add it if it does not exist):

 hgext.mq=

This enables the "strip" command, with which you can remove a unwanted revision. Absolutely necessary, because the great thing about distributed revision control is that one can commit early and often and then go back and clean up, often creating new commits to replace the old ones. But the old ones do not disappear after being abandoned. Or maybe you want to try out some revision from somebody else, and get rid of it afterwards.

 hgext.rebase=
 hgext.transplant=

These enable you to reorder history. Essential if you have an experimental feature followed by a bugfix and only want to push the bugfix to the public repository.