Configuring TortoiseHg (Windows)

These are the last few steps before you can actually start using TortoiseHg. We're going to tell it who you are, where you're private key is and we're going to tell it to use Unix style line endings to keep the repository nice and tidy. These are all settings you have to set in Mercurial.ini. That file has the same format as openttd.cfg, so that shouldn't be much of a problem. Just follow the next few steps and you're good.

Finding Mercurial.ini

There's actually two Mercurial.inis; one global for all users of your computer and a personal one for just you. We'll be editing the second one.

  • Your personal Mercurial.ini is located in the %USERPROFILE% folder. That's something like C:\Documents and Settings\Username on Windows version 5 or C:\Users\Username on Windows 6 and higher, but you can just type %USERPROFILE% in the address bar of Explorer and the correct folder will magically open.
  • Now find a file named Mercurial.ini and open it using your favourite plain text editor. If there's no such file, create an empty text file and rename it Mercurial.ini.
  • If you already have a Mercurial.ini, there's probably already some stuff in it. Just leave that in place and only add the things from the next three sections.

Whoooo are you, who who, who who?

Before you can commit you must set who you are. Your (nick)name is registered with commits so that your fellow developers know who to ask might there be questions about a certain commit. It's general practice to add your email address as well, however that's not mandatory for Hg to work.

  • In your Mercurial.ini find the [ui] section or type [ui] on a new line if it doesn't exist.
  • On the next line, type username = Your_Username <>
    • Ofcourse replacing Your_Username with your nickname and with your email address.

We'll show you what the complete personal Mercurial.ini file should look like at the end of this page.

Push credentials

You should keep the login data for the devzone on one place, so add the following section to your ini file:

openttdcoop.prefix =
openttdcoop.username = <username>
openttdcoop.password = <password>
openttdcoop.shemes = https

Ending with Line Endings

Note: there is a new extension: EolExtension

Unix operating systems use a different type of line ending than Windows. In order to keep things consistent it's decided that only Unix style line endings should be used in commits to the repository. But we're on Windows...
Fortunately a few simple lines added to Mercurial.ini can change all line endings automatically for you.

  • At the end of Mercurial.ini, create a line with [extensions] on it.
  • add eol =

All changes to Mercurial.ini

When you're done, your Mercurial.ini should look somewhat like the following. The example also includes stuff that TortoiseHg puts in it by default, so copying this to your own Mercurial.ini shouldn't hurt. Make sure to change username and the SSH paths accordingly if you do so! Don't forget to save the changes!

username = FooBaz <email@email.tld>
merge = kdiff3

devzone.prefix =
devzone.username = <devzone-username>
devzone.password = <devzone-password>
devzone.shemes = https

vdiff = vdiff
overlayicons = localdisks

[extensions] =
eol =

#recommend for MQ:
nodates = 1
git = 1

Next: Using TortoiseHg »